Results 1 to 2 of 2

Thread: Help about Access97 Workgroup (again)

  1. #1
    Guest

    Post

    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.

  2. #2
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Try this

    Code:
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width