<%
SET Conn=Server.CreateObject("ADODB.Connection")
Dim i,j,Sql
Set rt=Server.CreateObject("ADODB.Recordset")
'Conn.Open "Server=IP地址;Provider=sqloledb;Database=库名称;UID=用户名;PWD=密码;"
Conn.Open "Server=192.168.1.1;Provider=sqloledb;Database=mysql;UID=sa;PWD=mysql;"
%>
<%=rs(2)%> | "&rt(i).name) Next rt.close end if rs.MoveNext Wend %> |
dim conn,connstr,rs,sql
set conn = Server.CreateObject("Adodb.Connection")
connstr = "Provider=SQLOLEDB;data source=127.0.0.1;initial catalog=DBname;uid=username;pwd=password"
conn.open connstr
set rs = Server.CreateObject("Adodb.RecordSet")
sql = "select id from table"
rs.open sql,conn,1,1
if not rs.eof
response.write "ID为:" & rs("id")
end if
rs.close
conn.close
set conn=nothing
想学就从头学,想用就花钱买,不想学就别学
100元