How to get the Current DB? 
Author Message
 How to get the Current DB?

Hi!
I use Access 2000 DB that has a DB password.
I want to get a current DB.
I do:

 Set db = New Connection
    db.CursorLocation = adUseClient
    db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data    
Source=" & NomDeLaBase & ";Jet OLEDB:Database Password="&
_Password & ""
   Set gdbCurrentDB = OpenDatabase(NomDeLaBase, , 1, db)

But, it dont work.
Please help
Samba



Tue, 31 Aug 2004 17:49:12 GMT  
 How to get the Current DB?
hi,

I am not sure if this is what you need, but after you
opened connection to database, then DefaultDatabase
property of connection will keep name of database you are
connected to

Val

Quote:
>-----Original Message-----
>Hi!
>I use Access 2000 DB that has a DB password.
>I want to get a current DB.
>I do:

> Set db = New Connection
>    db.CursorLocation = adUseClient
>    db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data    
>Source=" & NomDeLaBase & ";Jet OLEDB:Database Password="&
>_Password & ""
>   Set gdbCurrentDB = OpenDatabase(NomDeLaBase, , 1, db)

>But, it dont work.
>Please help
>Samba

>.



Tue, 31 Aug 2004 20:16:35 GMT  
 How to get the Current DB?

Hi!
I use Access 2000 DB that has a DB password.
I want to get a current DB.
I do:

 Set db = New Connection
    db.CursorLocation = adUseClient
    db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data    
Source=" & NomDeLaBase & ";Jet OLEDB:Database Password="&
_Password & ""
   Set gdbCurrentDB = OpenDatabase(NomDeLaBase, , 1, db)

There is no such thing as a current database when using ADO. Since you are using
a Connection object to connect to your database, that is what you should be
using to generate your Recordsets, etc.

You're attempting to mix ADO and DAO (OpenDatabase) and that simply won't work.


Microsoft MVP (Visual Basic)



Tue, 31 Aug 2004 22:05:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting the path of the Current DB

2. Getting the path of the Current DB

3. Getting Errors when Access DB gets large

4. VBA date query - not getting current date

5. Access current DB in VBA script

6. Compacting current db in VBA

7. Path name of current DB

8. Current Db() Error - Urgent Help needed

9. Compact current DB

10. Check current db is replica

11. Make current DB exlusive from VBA code

12. ADO Current db question

 

 
Powered by phpBB® Forum Software