Friday, July 20, 2007

MySQL Connection String Information

If you are not familiar with the Internet and/or web hosting you may not know what MySQL is or even what a connection string is. A connection string is a string passed in code that specifies connection information directly to the Driver Manager and driver. iPowerWeb hosting accounts come with MySQL support, this means that if your web site needs to run programs and scripts that use MySQL - you are in good shape.
You can use the code found below this line to connect to a MYSQL Database through ASP. Please note: iPowerWeb Technical Support does not provide assistance with web scripting. The code below is provided out of courtesy.

<%

Dim DBName,DBUser,DBPass,objRS,objConn

'----------------------------------------------------
'DO NOT MODIFY ABOVE THIS LINE
'----------------------------------------------------


' Fill in the information below inside the quotation marks
DBName=""
DBUser=""
DBPass=""


'----------------------------------------------------
'DO NOT MODIFY BELOW THIS LINE
'----------------------------------------------------

Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={MySQL ODBC 3.51 Driver};Server=localhost;Database="&DBName&";UID="&DBUser&";pwd="&DBPass&";"
objConn.Open
Set objRS=Server.CreateObject("ADODB.Recordset")

%>

If you have additional questions or need assistance please contact our customer department at 888-511-HOST.

2 comments:

Anonymous said...

very helpful information. thanks

Terrence said...

Nice stuff. I love Mysql.