ASP links Mysql and reads data

xiaoxiao2021-03-06  51

ASP links Mysql and reads data

<%

'ASP link mysql program

'Need to load mySQLODBC driver download address

Http://www.mysql.com/downloads/api-myodbc-2.50.html

'E-mail: kaxue@hotmail.com QQ: 484110 HomePage:

www.flyday.net

'Sash Time: Thursday, May 23, 2002 5:54 PM Win2000 Server IIS5 test

StrConnection = "DSN = USER"

'strconnection = "defaultdir =; driver = {myodbc driver}; Database = BBS"

Set adodataconn = server.createObject ("adodb.connection")

Adodataconn.open strandnection

Strquery = "SELECT * from user where username =" kaxi ""

SET RS = Server.createObject ("AdoDb.Recordset")

Rs.Open Strquery, StrConnection, 2, 1

Response.Write Rs.Recordcount

IF not ly r

%>

UserName password

<%

Do While Not Rs.eof

%>

<% = rs ("Username")%> <% = rs ("password")%>

<%

rs.movenext

Loop

%>

<%

Else

Response.write ("Sorry, no data you need")

END IF

Rs.close

Adodataconn.close

Set adoDataconn = Nothing

%>

转载请注明原文地址:https://www.9cbs.com/read-116689.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.041, SQL: 9