sloppycode.net
ASP Database access: mySQL with Scibit.com drivers
Using mySQL with Scibit.com drivers
Home
›
Code snippets
›
ASP
›
ASP Database access: mySQL with Scibit.com drivers
A very basic example (kept here for reference) of using mySQL with ASP. The
scibit
drivers are commercial mySQL drivers, they come as an COM dll.
<% ' Over-ride 90 second default to 1 hour Server.ScriptTimeout = 21600 Dim mysql_host,mysql_username,mysql_password,mysql_port,mysql_database Dim mysqlObj,SQL,RS Dim i ' Database parameters mysql_host = "server" mysql_username = "username" mysql_password = "password" mysql_port = "3306" mysql_database = "database" 'On Error Resume Next Set mysqlObj = Server.CreateObject("SciBit.MySQLX") mysqlObj.Register "serialnumber" mysqlObj.Connect mysql_host,mysql_username,mysql_password,mysql_port,mysql_database ' Open recordset with SQL query Set RS = mysqlObj.Dataset SQL = "SELECT * FROM table" RS.SQL.Text = SQL RS.Open ' Start time Response.Write "Started: " & Hour(Now()) & ":" & Minute(Now()) & ":" & Second(Now()) & "<br>" ' Loop through the recordset Do While NOT RS.EOF ' do nothing RS.Next i = i +1 Loop ' End Time Response.Write "Finished: " & Hour(Now()) & ":" & Minute(Now()) & ":" & Second(Now()) & "<br>" Response.Write i & " records found." ' Error catching if Err<>0 then response.write Err.Description response.end End If %>
{Name}
Says:
{Date}
{Text}
› Home
› C#
› Snippets
› Articles
› Tools
› Taglines
› ASP
› Dictionary Object
› FSO
› Unix cheat sheet
› Gaming
› CSS
› Yak
› Umbraco
› About
› Contact
› Privacy
› Projects
› Search
› Sitemap
Buy on Amazon
Buy on Amazon
Buy on Amazon
Buy on Amazon