connection strings

J

Jason

Hi,

I was wondering how i could set connection strings from info in a table.

I have a table where i store the following data about connections:

Id
DataProvider
NetworkLibrary
DataSource
PortNr
Database
UID
PWD (don't know if i should store that in a table)

Also i have forms which get their recordsets from several databases. So i
want to adjust my ado connection function to use different connections by
getting the connection info from my table.

How can i do this?
 
D

Damiaan

Private Sub cmdConnect_Click()

Debug.Print CurrentProject.BaseConnectionString

str_Connection = "PROVIDER=SQLOLEDB.1;" & _
"PERSIST SECURITY INFO=FALSE;" & _
"INITIAL CATALOG=" & YOUR_DB & ";" & _
"DATA SOURCE=" & YOUR_HOST


CurrentProject.OpenConnection strConnection, USER, PWD

End Sub


--

Kind Regards
Damiaan
e: info at dampee.be
w: http://www.dampee.be
 

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