Here is my situation. I am building a website that many different customers will use. Each customer will have his/her own MySql Database which will house their information. Their initial authentication will take place using ASP.net roles
and users stored in a SQL 2005 server. Once authenticated the website will look for the customers connection string to his/her MySQL database. I have the authentication and connection string retrieval working but I am not sure how to
use the connection string with the ADO.net connector to make this all come together. Here is an example from the godaddy website, but how can I insert the connection string I have retrieved from the SQL 2005 server for the user....
Dim oConn, oRs
Dim qry, connectstr
Dim db_name, db_username, db_userpassword
Dim db_server
db_server = "mysql.secureserver.net"
db_name = "your_dbusername"
db_username = "your_dbusername"
db_userpassword = "your_dbpassword"
fieldname = "your_field"
tablename = "your_table"
connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr
qry = "SELECT * FROM " & tablename
Set oRS = oConn.Execute(qry)
if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & "
"
oRS.movenext
wend
oRS.close
end if
Set oRs = nothing
Set oConn = nothing
Any suggestions would be appreciated. Thank you.
解决方案This is a C# forum and this looks like VB6 code.
What language are you planning to use for this task?