Microsoft Jet workspace

D

Delali

Hi,
I am trying to connect to and query an access database
and i've tried using Microsoft Jet workspace and
ODBCDirect workspace.

i prefer to use Microsoft Jet workspace becuase it
uses "" to identify variables in SQL statements which
allow the character ' in variable names. Using ODBCDirect
workspace require using ' to identify variables in SQL
statements and therefore the variable cannot have the
character ' in it.

The problem i have now is that i can't connect to a
database with a password using Microsoft Jet workspace.
i have the following code but it is not working:
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)

Set dbs = wrkJet.OpenDatabase(fname, False,
False, "DATABASE=MS Access Database;PWD=xxx;UID=Admin")

i think the problem is with the connection string. can
anyone please help me?
 
G

Guest

I can't answer your question specifically; however, if you take a look at
www.connectionstrings.com they have quite a comprehensive list of connection
strings and I believe I've seen ones that refer to opening an access database
with a password.

HTH,
John
 
J

Jamie Collins

Delali said:
i can't connect to a
database with a password using Microsoft Jet workspace.
i have the following code but it is not working:
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)

Set dbs = wrkJet.OpenDatabase(fname, False,
False, "DATABASE=MS Access Database;PWD=xxx;UID=Admin")

Try:

Set wrkJet = CreateWorkspace("MyWorkspace", "admin", "xxx", dbUseJet)
Set dbs = wrkJet.OpenDatabase(fname, False, False)

Jamie.

--
 
K

Kevin

I use this connection string for my VB. The mdb has a password. It looks
for the database in the same directory the program is running in.

Good Luck!

Kevin

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & CurDir &
"\Data.mdb;Persist Security Info=False;Jet OLEDB:Database Password=letmein"
 
J

Jamie Collins

Kevin said:
I use this connection string for my VB. The mdb has a password. It looks
for the database in the same directory the program is running in.

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & CurDir &
"\Data.mdb;Persist Security Info=False;Jet OLEDB:Database Password=letmein"

AFAIK you can't use the OLEDB provider for Jet 4.0 with DAO.

Jamie.

--
 
K

Kevin

Yea, I am using ADO in my VB project..... I don't know how to do this in
DAO,,,,,

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top