mysql.com 에 접속해서 oledb 다운받아 설치
<%
strcon = "Provider=MySqlProv;Location=아이피;Data Source=디비명;User ID=아이디;Password=비밀번호;"
set DbCon = Server.CreateObject("ADODB.Connection")
DbCon.open strcon
%>
SQL_query = "SELECT count(*) FROM 테이블명"
Set RS = DbCon.Execute(SQL_query)
Response.Write " Query : " + SQL_query + "
"
Response.Write " Result : "
while not RS.eof
Response.Write RS(0)
Response.Write "
"
RS.MoveNext
wend
RS.Close
DbCon.Close
set RS = nothing
set DbCon = nothing
[odbc 로 접속할 경우]
mysql.com 에 접속해서 myodbc 다운받아 설치
<%
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open "mysql"
SQL_query = "SELECT * FROM your_table WHERE your_field LIKE '%abc%';"
Set RS = MyConn.Execute(SQL_query)
%>
<% Response.Write SQL_query %>
<%while not RS.eof%>
<%=RS("FIELD1")%> <%=RS("FIELD2")%> <%=RS("FIELD3")%>
<%RS.MoveNext%>
<%wend%>
<%
RS.Close
MyConn.Close
%>
Posted by 홍반장