SiSi的博客

ssdoll.cn

rs.open sql,conn 与conn.execute(sql)的区别

asp怎样将表单信息写入sql数据库

如果是直接用ADODB连接的话,就像这样
<SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER">
Sub Application_onStart
Application("ConnectDataSourceString")="DSN=sjy;UID=sa;PWD=;"
Sub Application_onEnd
End sub
</Script>

在ASP页面上调用
<%
Dim conn,strconn
Set conn= Server.CreateObjec(“ADODB.Connection”)
Conn.open Application("ConnectDataSourceString")
%>

如果楼主是说插入语句的话,就像这样
<%
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "select * from table",conn,1,2
rs.AddNew
rs("字段名")=Request("传来的值")
rs.Update
%>

Powered By Z-BlogPHP 1.7.3

Copyright ssdoll.cn Rights Reserved.