<% session.codepage = 1255 DBType = "mysql" 'MySQL ODBC Connection String datasourcename = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost;DATABASE=databasename; USER=username; PASSWORD=password; port=3309 OPTION=3;" cursortype = 3 Set DataConn = Server.CreateObject("ADODB.Connection") DataConn.Open datasourcename Set cmdTemp = Server.CreateObject("ADODB.Command") Set rs_main = Server.CreateObject("ADODB.Recordset") Sub ExecuteSQL(QueryText, cursortype, recordsetname) '------------------------------------------- 'THE TWO LINES BELOW ARE FOR DEBUGGING 'UNCOMMENT THEM IF QUERIES ARE FAILING '------------------------------------------- Response.Write(QueryText&"

") 'On Error Resume Next cmdTemp.CommandText = QueryText cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = DataConn If DBType = "mysql" Then recordsetname.CursorLocation = 3 recordsetname.Open cmdTemp, , 1, cursortype End Sub theQuery = "SELECT ART_heading FROM tblsystemarticles ART_heading WHERE ART_id=1" Call ExecuteSQL(theQuery, CursorType, RS_Main) '----------------------------------------------------------- '----------------------------------------------------------- if not RS_Main.eof then CAT_heading = rs_main("ART_heading") end if rs_main.close %> Hello Alon's World
<%=CAT_heading%>