Open database from VBA with different workgroup. 
Author Message
 Open database from VBA with different workgroup.

Hi there,

I'm trying to open a database (through code) using a different workgroup
file.

e.g.:
I'm logged in to access as user 'admin' with the default workgroupfile and I
want to open another database (opendatabase method) using another
workgroupfile. I found something about the 'sytemdb' property of the
dbengine object, but I can't get it to work.

Can anybody help.

If possible, please reply also to e-mail address

Thanks

Sven De Bont
Tangram Data NV



Tue, 01 Aug 2000 03:00:00 GMT  
 Open database from VBA with different workgroup.

Quote:
>>I'm trying to open a database (through code) using a different workgroup

file.<<

I'm pretty sure you can't do this. We were talking about this further down
in a thread on manipulating objects in other databases.

The SystemDB property is read-only after Jet starts. (In Access, there is no
time when Jet isn't running, so you can't ever set this property in Access.)
Moreover, the CreateWorkspace method doesn't have an argument for the
workgroup file to use.

You can execute a command line in code which starts a second copy of Access.
The command line can have the /wrkgrp switch. Then you set an object
reference to the second instance of Access and go from there... but that
makes me feel squeamish, too. 'Cause then you have to negotiate with another
Application object, and that's not necessarily what you want...

Adam



Tue, 01 Aug 2000 03:00:00 GMT  
 Open database from VBA with different workgroup.

You cannot do this with conventional means in Access. Once Access starts it
inits the DBEngine and once that happens you cannot change the workgroup.

You can do one of the following:

1) Call CreateObject on "DAO.DBEngine.35" to create a new DBEngine, then set
its SystemDB prop and run from there.

2) Dim a variable as New PrivDBEngine and proceed as in #1.

Michael

Quote:

>Hi there,

>I'm trying to open a database (through code) using a different workgroup
>file.

>e.g.:
>I'm logged in to access as user 'admin' with the default workgroupfile and
I
>want to open another database (opendatabase method) using another
>workgroupfile. I found something about the 'sytemdb' property of the
>dbengine object, but I can't get it to work.

>Can anybody help.

>If possible, please reply also to e-mail address

>Thanks

>Sven De Bont
>Tangram Data NV



Tue, 01 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Launching a different database from a different db w/ vba

2. Opening different database

3. Close Database Then Open Different Application

4. How to Open a different Database File Whithin another

5. Opening a different database

6. Open different database file within Access using code

7. Access Server on a Different Workgroup

8. how to access a shared folder on different workgroup

9. Opening different databases/user

10. linking tables in different workgroups

11. Opening different DBASE-Databases at runtime via DAO

12. Open Two Database with Two System.Mda and Two different User Names and Password

 

 
Powered by phpBB® Forum Software