Re Data Control with ADO msjet 3.6 Libaray 
Author Message
 Re Data Control with ADO msjet 3.6 Libaray

Can anybody help I am trying to use a Data Control to load a DB from Access
2000 (DAO 3.6 Object Library). When I try to load the DB in to the Data
Control I get the message (Couldn't use `C:\VB Work\VB6\VB6
Projects\Lac_DataForm1\LAC1.mdb`;file already in use.). The code below is
now I am trying load the DB.

  Dim ws As Workspace
  Dim Mdb As Database
  Dim g_ds_members As Recordset

 ' Create Microsoft Jet Workspace object.
    Set ws = CreateWorkspace("", "admin", "", dbUseJet)

    ' Initialise the database and dynaset object.
    Set Mdb = ws.OpenDatabase(App.Path & "\LAC1.mdb", True)
    frmMembers!dc_members.DatabaseName = App.Path & "\LAC1.mdb"
    Set g_ds_members = Mdb.OpenRecordset("SELECT * from members")

Thanks
 Rick Jackson




Sat, 13 Apr 2002 03:00:00 GMT  
 Re Data Control with ADO msjet 3.6 Libaray
you probably already have the mdb file open in another application..
it may be that you a copy of your application still residing in memory -
make sure they are all killed before re-starting


Quote:
>Can anybody help I am trying to use a Data Control to load a DB from Access
>2000 (DAO 3.6 Object Library). When I try to load the DB in to the Data
>Control I get the message (Couldn't use `C:\VB Work\VB6\VB6
>Projects\Lac_DataForm1\LAC1.mdb`;file already in use.). The code below is
>now I am trying load the DB.

>  Dim ws As Workspace
>  Dim Mdb As Database
>  Dim g_ds_members As Recordset

> ' Create Microsoft Jet Workspace object.
>    Set ws = CreateWorkspace("", "admin", "", dbUseJet)

>    ' Initialise the database and dynaset object.
>    Set Mdb = ws.OpenDatabase(App.Path & "\LAC1.mdb", True)
>    frmMembers!dc_members.DatabaseName = App.Path & "\LAC1.mdb"
>    Set g_ds_members = Mdb.OpenRecordset("SELECT * from members")

>Thanks
> Rick Jackson





Sun, 14 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DAO 3.6 and data controls

2. strange data control behaviour with DAO 3.6 and SQL server

3. DAO 3.6 DAta Control wont refresh

4. Data Controls and DAO 3.6

5. DAO 3.6 and Data Controls - Class not registered

6. Changing Field Properties via ADO 3.6

7. ADO and DAO 3.6

8. 3259 - Invalid Field data type with DAO 3.6 in VB

9. MSJet 3.51 vs. MSJet 4.0

10. OLE Container Control , Org Chart and DAO 3.6

11. ADO data control 6.0 and ADO data object 2.1 conflict

12. Using ADO Data Control on User Control as Data Source

 

 
Powered by phpBB® Forum Software