ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA in Excel & ADO: some problems (https://www.excelbanter.com/excel-programming/337475-vba-excel-ado-some-problems.html)

Santiago[_2_]

VBA in Excel & ADO: some problems
 
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.

Bob Phillips[_6_]

VBA in Excel & ADO: some problems
 

"Santiago" wrote in message
...
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"
..



Simon Letten

VBA in Excel & ADO: some problems
 
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.
--
HTH

Simon


"Santiago" wrote:

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.


Santiago[_2_]

VBA in Excel & ADO: some problems
 
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


"Simon Letten" wrote:

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.
--
HTH

Simon


"Santiago" wrote:

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.


Bob Phillips[_6_]

VBA in Excel & ADO: some problems
 
I gave you that in my response.

--

HTH

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


"Santiago" wrote in message
...
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


"Simon Letten" wrote:

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.
--
HTH

Simon


"Santiago" wrote:

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.




Santiago[_2_]

VBA in Excel & ADO: some problems
 
Thanks, but what I mean is the userid and pass used in the Connection string
is the one that I put in access in "TOOLSSECURITYUSER AND GROUP ACCOUNTS"??

thanks

bregards

Santiago

"Bob Phillips" wrote:

I gave you that in my response.

--

HTH

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


"Santiago" wrote in message
...
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


"Simon Letten" wrote:

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.
--
HTH

Simon


"Santiago" wrote:

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.





Santiago[_2_]

VBA in Excel & ADO: some problems
 
forget abt my questions, solved it!

thanks

"Santiago" wrote:

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

thanks

bregards

Santiago

"Bob Phillips" wrote:

I gave you that in my response.

--

HTH

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


"Santiago" wrote in message
...
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


"Simon Letten" wrote:

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.
--
HTH

Simon


"Santiago" wrote:

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.






All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com