RE: Opening Access DB From VB 6 Error

From: Nick (anonymous_at_discussions.microsoft.com)
Date: 05/13/04


Date: Thu, 13 May 2004 06:01:07 -0700


     Hi James,

I tested your code and it works fine:

Dim X As Object
Set X = CreateObject("access.application")
X.Visible = True
X.OpenCurrentDatabase "\\mycomputer\myshare\testdisc.mdb"
Set X = Nothing

Though I did notice a typo with regards to the .mdb file.

brg
/Nick

     ----- James W wrote: -----
     
     When I try to open an Access 2000 database using the following VB 6
     script I get the error 7866 Microsoft Access can't open the database
     because it is missing, or exclusively locked by another user. I have
     checked and the database is where the link says and was not being used
     by another user.
     
     Private Sub Command11_Click()
     Dim X As Object
     Set X = CreateObject("access.application")
     X.Visible = True
     X.OpenCurrentDatabase
     "\\admin\compsect\data\databases\inventory\inventory.mbd"
     Set X = Nothing
     End Sub
     
     Any help would be appreciated.
     



Relevant Pages

  • Re: Need help with a DAO to ADO conversion
    ... Doug Steele, Microsoft Access MVP ... Dim conBackend As ADODB.Connection ... where the compatibility version of the back-end database is set. ... Dim strDDL As String ...
    (microsoft.public.access.formscoding)
  • Re: Copy a table and rename it
    ... Doug Steele, Microsoft Access MVP ... After you create the database, you don't need it to be instantiated. ... Set dbNew = DBEngine.Workspaces.CreateDatabase(NewFolder, ... Dim appAccess As Access.Application ...
    (microsoft.public.access.modulesdaovba)
  • Re: Non-unique KeyIDs (Autonumber) in Access 2000
    ... Microsoft Access 2003 VBA Programmer's Reference ... > database to a new clean database. ... > Dim WS As Workspace, DB As Database, TempDB As Database ... we are seeing a number of tables where the autonumber is being ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Non-unique KeyIDs (Autonumber) in Access 2000
    ... Microsoft Access 2003 VBA Programmer's Reference ... > to the next highest number, this will reset the stored Autonumber to the ... >>> database to a new clean database. ... >>> Dim WS As Workspace, DB As Database, TempDB As Database ...
    (microsoft.public.access.tablesdbdesign)
  • File Format Problem - I think!
    ... I have been personalising the Microsoft Access 97 ... I converted my database file using the Access Tools → Database Utilities → ... ' Fill in the options for this switchboard page. ... Dim dbs As Database ...
    (microsoft.public.access.gettingstarted)

Loading