关于数据库语句

来源:百度知道 编辑:UC知道 时间:2024/05/31 15:09:55
<%
dim dbpath
dbpath=""
%>
<!--#include file=Conn.asp -->
<!--#include file=include/MyRequest.asp -->
<!--#include file=Sub.asp -->
<%
call up("会员注册","会员注册","会员注册")
Set rs=Server.CreateObject("ADODB.Recordset")
sql="INSERT INTO root_info (root_info_uname) VALUES ("'&root_info_uname&'")"
set rs=conn.execute(sql)
rs.close
set rs=nothing
response.write "<table border=0 width=100% cellpadding=4 style=border-collapse: collapse>"
response.write "<img src='http://53fw.net/fw/images/skyblue/user/u_t_reg.gif'></img>"
response.write "<form id='u1' name='yregister' method='post' action='uregister.asp'>"
response.wr

好好看看,下面是一个类
<!--#include file="adovbs.inc"-->
<%

Class DBConn

Private Conn,ConnStr
Public Rs,Cmmd

Private Sub OpenConn()
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Set Cmmd = Server.CreateObject("ADODB.Command")
ConnStr="DRIVER={SQL Server};SERVER=100.1.103.126;UID=sa;PWD=fgadmin;DataBase=ERP"
Conn.Open ConnStr
End Sub
Public Sub CloseRs()
if Rs <> null then
Rs.Close()
End if
End sub
Public Sub CloseConn()
If Conn <> null then
Conn.Close()
Set Conn = Nothing
Set Cmmd = Nothing
End If
End Sub

Public Sub CreateCommandProc(Byval procName, ByRef Parameter)
OpenConn()
Set Cmmd = Parameter
Set Cmmd.ActiveConnection = Conn
Cmmd.CommandType = adCmdStoredProc
Cmmd.Co