PDA

Click to See Complete Forum and Search --> : Help about Access97 Workgroup (again)


Jun 1st, 2000, 11:15 AM
I know I've asked this question before but I am still having a problem. How can I set the path of mdw file, user name, and password in run time on VB6. For example.

dim AppAccess as new Access.Application

** AppAccess.DBEngine.SystemDB="your.mdw"
AppAccess.DBEngine.DefaultUser="UserID"
AppAccess.DBEngine.DefaultPassword="PasswordforaboveUser"

AppAccess.OpenCurrentDatabase("your mdb")
AppAccess.Visible = True

The above code works perfectly if the workgroup jointed to the System.mdw. But it doesn't work if the workgroup jointed to another mdw file. Whenever the VB6 hits the ** line. It pops up a dialog box asks for the UserID and the password. How can I bypass this dialog box by writing VB code?? Thanks in advance. :)

Gary.Lowe
Jun 1st, 2000, 09:58 PM
Try this



Dim AppAccess as new Access.Application

'useing the AppAccess.DBEngine.SystemDB seems automatically use your MSAccess default MDW, this way should enable the specified mdw to be used

DBEngine.SystemDB="your.mdw"
AppAccess.DBEngine.DefaultUser="UserID"
AppAccess.DBEngine.DefaultPassword="PasswordforaboveUser"

AppAccess.OpenCurrentDatabase("your mdb")
AppAccess.Visible = True



Hope this helps

Gaz