Using MySQL 5.10 Driver with VP-ASP v6.50

Using MySQL 5.10 Driver with VP-ASP v6.50

This helpnote is for VPASP 6.50 and earlier users

When moving servers you may find that your new host has a more recent MySQL driver installed than your previous host.

Earlier versions of VPASP only support up to MySQL 3.51 by default however this can be easily fixed by adding some code to your cart as follows.

1. Open shop$db.asp using a text or HTML editor.

2. Locate the following code:
(around line 319-322)

if databasetype="MYSQL351" then
ProcessMYSQLServer connection
exit sub
end if
3. Change it into the following code:

if databasetype="MYSQL351" then
ProcessMYSQLServer connection
exit sub
end if

if databasetype="MYSQL510" then
ProcessMYSQLServer connection
exit sub
end if
4. Locate the following code:
(around line 458-464)

if ucase(xdatabasetype)="MYSQL351" then
mysqlconn="DRIVER={MYSQL ODBC 3.51 Driver};"
else
mysqlconn="DRIVER={MySQL}; "
end if
mysqlconn=mysqlconn & " Server=" & varServerIP & "; Database=" & varDataBaseName & "; UID=" & varUserName & "; PWD=" & varPassword
Connection.Open mysqlconn
5. Change it into the following:

if ucase(xdatabasetype)="MYSQL351" then
mysqlconn="DRIVER={MYSQL ODBC 3.51 Driver};"
elseif ucase(xDatabaseType)="MYSQL510" then
mysqlconn="DRIVER={MySQL ODBC 5.1 Driver}; "
else
mysqlconn="DRIVER={MySQL}; "
end if
mysqlconn=mysqlconn & " Server=" & varServerIP & "; Database=" & varDataBaseName & "; UID=" & varUserName & "; PWD=" & varPassword
Connection.Open mysqlconn

if ucase(xDatabaseType)="MYSQL510" then
Connection.execute "set sql_mode='NO_BACKSLASH_ESCAPES';"
end if
6. Locate the following code:
(around line 856-859)

if databasetype="MYSQL351" then
ProcessMYSQLServer connection
exit sub
end if
7. Change it into the following code:

if databasetype="MYSQL351" then
ProcessMYSQLServer connection
exit sub
end if

if databasetype="MYSQL510" then
ProcessMYSQLServer connection
exit sub
end if
8. Locate the following code:
(around line 1091-1092)

if databasetype="MYSQL" or databasetype="MYSQL351" then
ProcessMYSQLServer connection
9. Change it into the following code:

if databasetype="MYSQL" or databasetype="MYSQL351" then
ProcessMYSQLServer connection
RestoreSessionDB
exit sub
end if

if databasetype="MYSQL510" then
ProcessMYSQLServer connection
10. Save the file.

Once you have updated shop$db.asp, simply set the following code in shop$config.asp:

const xdatabasetype="MYSQL510"


Times Viewed:
4349
Added By:
Angelo
Date Created:
3/16/2012
Last Updated:
3/16/2012