VBA in Excel & ADO: some problems

G

Guest

Hey guys,

I'm quite new in ADO and I need some help...

1) can the same MSAccess database be accessed from Excel using ADO at the
same time?? what should be the "mode" property on the connection string??

2) how can I put a password to the database and access to it from MSExcel
using ADO?? should I use the "user" and "password" property in the connection
string??

Any hint will help me out here. Thanks.

Bregards

Santiago.
 
B

Bob Phillips

Santiago said:
Hey guys,

I'm quite new in ADO and I need some help...

1) can the same MSAccess database be accessed from Excel using ADO at the
same time?? what should be the "mode" property on the connection string??

Yes you can. As it is being shared, you would not want tyo try and open it
exclusivley, so don't set it at all.
2) how can I put a password to the database and access to it from MSExcel
using ADO?? should I use the "user" and "password" property in the connection
string??

Yes, here is an example

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDB:Database Password=MyDbPassword", _
"myUsername", "myPassword"
..
 
G

Guest

1. Yes you can connect to the same database more than once. The mode
property depends on whether you want to modify the data and whether you want
more than one person to be able to read/update the database at the same time

2. You'll need to specify the UserId and Password when you open the
connection, e.g. connection.Open strConectString, strUserId, strPassword.
You might need to specify which System Db you're using in the connection
string, i.e. the Jet OLEDB:System Database parameter.
 
G

Guest

Ok Guys thanks.

So ... if I do not specify the mode property, users can access update and
read data at the same time... good

I know how to specify userid and pass in ADO, but how can I add password to
the database in Access?? I know it should not be in this forum but since it's
all related...

Thanks again. Bregards
 
B

Bob Phillips

I gave you that in my response.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

Guest

Thanks, but what I mean is the userid and pass used in the Connection string
is the one that I put in access in "TOOLS>SECURITY>USER AND GROUP ACCOUNTS"??

thanks

bregards

Santiago
 
G

Guest

forget abt my questions, solved it!

thanks

Santiago said:
Thanks, but what I mean is the userid and pass used in the Connection string
is the one that I put in access in "TOOLS>SECURITY>USER AND GROUP ACCOUNTS"??

thanks

bregards

Santiago
 

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

Similar Threads


Top