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

  • Thread starter Thread starter Jesper F
  • Start date Start date
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
 
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 <--
 
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
 
Back
Top