I am trying to set up a dynamic dsnless connection string, so I can use one set of pages connecting to different dabases (they all are the same, tables and fields, but different names.) A user chooses a database name, username and password. it is stored as a cookie, then it is retrieved to be used for the dsnless sting. The only way I know how, is below:
Sub Session_OnStart
Session("dbconn_ConnTimeout"
= 30
Session("dbconn_CommandTimeout"
= 60
Session("dbconn_CursorLocation"
= 2
Session("dbconn_Host"
= Request.Cookies("database"
Session("dbconn_UserName"
= Request.Cookies("username" )
Session("dbconn_Password"
= Request.Cookies("password" )
Session("dbconn_DsnlessString"
= "DRIVER={MySQL};SERVER=66.xxx.xxx.xxx;DATABASE="&Session("dbconn_Host"
&";UID="&Session("dbconn_UserName"
&";PASSWORD="&Session("dbconn_Password"
&""
End Sub
I can pull the variables from the cooke, but when I do a Response.Write Session("dbconn_DsnlessString"
, nothing shows up.
Any Ideas?....
Sub Session_OnStart
Session("dbconn_ConnTimeout"
Session("dbconn_CommandTimeout"
Session("dbconn_CursorLocation"
Session("dbconn_Host"
Session("dbconn_UserName"
Session("dbconn_Password"
Session("dbconn_DsnlessString"
End Sub
I can pull the variables from the cooke, but when I do a Response.Write Session("dbconn_DsnlessString"
Any Ideas?....