ODBC to SQL-server - how do I log in via code

J

Jesper F

I have a db with ODBC-linked tables on a hosted MSSQL server.
When I open the first table I'm asked to enter the username and password and
it's working fine.

Could I integrate this into the code of the app, so that I'm not asked to
enter this every time?
I've used DAO throughout the app. The connection string I use on my website
to access the database is this:
"Provider=SQLOLEDB.1;" &_
"Data Source=(local);" &_
"Initial Catalog=MyUsername;" &_
"User ID=MyUsername;" &_
"Password=MyPassword;"

How can I connect automatically via my Access database (frontend)?



Jesper
 
S

stefan hoffmann

hi Jesper,

Jesper said:
Could I integrate this into the code of the app, so that I'm not asked to
enter this every time?
How can I connect automatically via my Access database (frontend)?
Create a passthrough query with the complete connection string and open
it in VBA.
The credentials will be cached until you close Access. Every table or
query having the same connection string will use this information.


mfG
--> stefan <--
 
J

Jesper F

Could I integrate this into the code of the app, so that I'm not asked to
Create a passthrough query with the complete connection string and open
it in VBA.
The credentials will be cached until you close Access. Every table or
query having the same connection string will use this information.

Thanks, that works great.


Jesper
 

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