Dynamic connection string

G

Guest

Hi,

this is what my connection string is as per below , how do i actually make
it dynamic , becoz this ms access program is to be used in many countried
which has their own SQL Server , i need it to prompt the user once for that
session
how do i do that ?

Dim conn1 As New ADODB.Connection
Dim cmdStr As New ADODB.Command
Dim prmSumOfMoney As New ADODB.Parameter
Dim prmRefNo As New ADODB.Parameter
Dim SumOfMoney As Currency
Dim strLoc As String


strLoc = "Provider=SQLOLEDB;Data Source=WWF;Initial Catalog=TEST User
ID=ssaa;Password=123;"

tls & rdgs
 
A

Alex Dybenko

Hi,
you can make a form for entering Login/password, and then build your
connection string as:

strLoc = "Provider=SQLOLEDB;Data Source=WWF;Initial Catalog=TEST;User ID=" &
me.login & ;Password=" & me.password ";"

assuming that login and password are textboxes on this form
HTH
 
A

Alex Dybenko

Hi, same like user:

strLoc = "Provider=SQLOLEDB;Data Source=" me.server & ";Initial
Catalog=TEST;User ID=" &
me.login & ;Password=" & me.password ";"
 

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