Article ID: 129880
Article Last Modified on 1/8/2003
Sub Form1_Load ()
Dim DB As Database
SetDefaultWorkspace "Admin", "WrongPassword"
' VB3: Error occurs on SetDefaultWorkspace
Set DB = OpenDatabase("MyDB.MDB")
' Insert the name of a secured Microsoft Access database in
' the line above.
End Sub
Sub Form1_Load ()
Dim DB As Database
SetDefaultWorkspace "Admin", "WrongPassword"
Set DB = DBEngine.Workspaces.OpenDatabase("MyDB.MDB")
' Insert the name of a secured Microsoft Access database
' in the line above.
' VB4: Error occurs on OpenDatabase.
End Sub
Sub Form1_Click()
Dim WS As WorkSpace
Dim DB As Database
DBEngine.DefaultUser = "Admin"
DBEngine.DefaultPassword = "WrongPassword"
Set WS = DBEngine.CreateWorkSpace("WS")
Set DB = WS.Opendatabase("MyDB.MDB")
' Insert the name of a secured Microsoft Access database in the
' line above.
End Sub
Error trapping may have to be moved in order to accommodate the multiple
Workspace capability of Visual Basic version 4.0. Error trapping should be
set up to trap on the Opendatabase or CreateWorkspace methods.
Additional query words: 4.00 vb4win vb4all
Keywords: kbprb KB129880