Opening a db within Access VB code 
Author Message
 Opening a db within Access VB code

I am trying to open another db within a module in Access and am using the
following code but get an error
couldn't find installable ISAM.  What is wrong? strUID and strPWD were
initialized to the user and password that I want accessing the db.  Thanks
in advance.

    Set wsp = DBEngine.Workspaces(0)
    ' Return reference to Another.mdb.
    Set dbsAnother = wsp.OpenDatabase("C:\MyDb.mdb", True, False, ("Access;
UID=strUID; pwd=strPWD"))

Dianne



Wed, 27 Mar 2002 03:00:00 GMT  
 Opening a db within Access VB code
Access isn't a valid parameter to put within a connect string.

Try:

Set dbsAnother = wsp.OpenDatabase("C:\MyDb.mdb", True, False,
"UID=strUID;pwd=strPWD")

Can't remember, but you may have to supply your UID and password when
you create the workspace too:

Set wsp = CreateWorkspace("temp", strUID, strPWD, type)

Quote:

> I am trying to open another db within a module in Access and am using the
> following code but get an error
> couldn't find installable ISAM.  What is wrong? strUID and strPWD were
> initialized to the user and password that I want accessing the db.  Thanks
> in advance.

>     Set wsp = DBEngine.Workspaces(0)
>     ' Return reference to Another.mdb.
>     Set dbsAnother = wsp.OpenDatabase("C:\MyDb.mdb", True, False, ("Access;
> UID=strUID; pwd=strPWD"))

> Dianne

--

Beer, Wine and Database Programming.  What could be better?
Visit "Doug Steele's Beer and Programming Emporium"
http://webhome.idirect.com/~djsteele/



Thu, 28 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Open Access DB within VB and pass to

2. Converting Access 2.0 DB to Access 97 DB in VB code

3. Opening a DB from within a DB

4. How to open another database from within Access using code

5. Open different database file within Access using code

6. Problem when accessing a SQL Anywhere DB from within VB 5

7. creating access db within vb 3.0

8. Unable to open VB Code Win after Securing DB

9. Print/View Access Report from within VB (with database open)

10. opening a access db while in anouther db

11. Compressing Access files from within VB code

12. Accessing VB code within Javascript

 

 
Powered by phpBB® Forum Software