help! run a query with ADO or DAO

J

jjj

Hi,

Im desperately trying to run a query with code. I have tried using the Docmd
command which worked but the database Im connecting to has linked tables and
its asking for a password and i dont know how to specify one.

I have tried using ADO ...not many resources on internet I can connect to
the database with connection string but when i say set rs =
cnn.execute("qryMyquery") I get an error.

can anyone help me or point me in the right direction? maybe i could use
DAO??
 
P

pietlinden

Hi,

Im desperately trying to run a query with code. I have tried using the Docmd
command which worked but the database Im connecting to has linked tables and
its asking for a password and i dont know how to specify one.

I have tried using ADO ...not many resources on internet I can connect to
the database with connection string but when i say set rs =
cnn.execute("qryMyquery") I get an error.

can anyone help me or point me in the right direction? maybe i could use
DAO??

if you want to return a recordset then you have to use

set rs=cnn.OpenRecordset strObjectName

or similar...

set the password stuff in the connection properties.
 
J

John

Right

Let me give you some facts

Access 2000, Windows 2000, trying to connect to Sybase system 11, I have
tried a dsn, i have tried a UDL etc etc - i think there may be a problem
with the ODBC driver...
Hi,

Im desperately trying to run a query with code. I have tried using the
Docmd
command which worked but the database Im connecting to has linked tables
and
its asking for a password and i dont know how to specify one.

I have tried using ADO ...not many resources on internet I can connect to
the database with connection string but when i say set rs =
cnn.execute("qryMyquery") I get an error.

can anyone help me or point me in the right direction? maybe i could use
DAO??

if you want to return a recordset then you have to use

set rs=cnn.OpenRecordset strObjectName

or similar...

set the password stuff in the connection properties.
 

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