Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should be too easy

Status
Not open for further replies.

Fatih235

MIS
May 30, 2002
19
0
0
US
Hey all;

I have a very simple question.I am using Access for database and now i put a password to it to make it secure.
What is the syntax to implement this password in my asp pages so that database interactivity can be done?My existing code is ;

Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("pc.mdb")
 
Dear Sir

you can use following Code :

ConnectString = "Your Connection String"
DBUsername = " Your UserName "
DBPassword = " Your Password "

DBConn.Open ConnectString, DBUsername, DBPassword

Better than above is that you set this variable as Application Variable Like This :

Application("ConnectString") = "Your Connection String"
Application("DBUsername") = " Your UserName "
Application("DBPassword") = " Your Password "

call this variable in your first page and then use them in all of your pages like this :

DBConn.Open Application("ConnectString"),Application("DBUsername"),Application("DBPassword")

Regards
 
or if you wanted to keep it as you current have it ..

Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open &quot;DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=&quot; & Server.MapPath(&quot;pc.mdb&quot;) & &quot;;pwd=<password here>&quot;

(I try to avoid IIS Session and Application variable use wherever possible) codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top