- postman - 狂人web日记

All for one,One for all!

qCon.asp


<%
'//-------get con_str ---------//
con_str=open_con_str(".","sa","sa","Nanyi")


'//------- con_str maker ---------//
function open_con_str(ConServe,ConUser,ConPassWord,ConDatabase)
 open_con_str = "Driver={SQL Server};Server=" & ConServe & ";UID=" & ConUser & ";PWD=" & ConPassWord & ";Database=" & ConDatabase & ""
end function

'//-------open connection ---------//
function oConn()

 set oConn=server.CreateObject("ADODB.connection")
 oConn.ConnectionString=con_str
 oConn.CursorLocation=3
 oConn.Open
 
end function

'//-------open RecordSet LockType 1---------//
Function oRd(sql_str)

 Set oRd = Server.CreateObject("ADODB.Recordset")
 oRd.ActiveConnection = con_str
 oRd.Source = sql_str
 oRd.CursorType = 0
 oRd.CursorLocation = 2
 oRd.LockType = 3
 oRd.Open()
 oRd_numRows = 0
 
 End Function
 
 '//-------open RecordSet LockType 3---------//
Function oRd3(sql_str)

 Set oRd3 = Server.CreateObject("ADODB.Recordset")
 oRd3.ActiveConnection = con_str
 oRd3.Source = sql_str
 oRd3.CursorType = 3
 oRd3.CursorLocation = 2
 oRd3.LockType = 3
 oRd3.Open()
 oRd3_numRows = 0
 
 End Function

'//-------close RecordSet ---------//
function cRd(rdset)

 rdset.close
 set rdset=nothing
 
end function

'//-------open Command ---------//
function oCmd(sql_str)
 set CmdConn=oConn()
 Set oCmd=Server.CreateObject("ADODB.Command")
 
 Set oCmd.ActiveConnection = CmdConn
 oCmd.commandText=sql_str
end function

'//-------open Command to Rs---------//
function oCmdRd(sql_str)
 set CmdConn=oConn()
 Set oCommand=Server.CreateObject("ADODB.Command")
 
 Set oCommand.ActiveConnection = CmdConn
 oCommand.commandText=sql_str
 Set oCmdRd=oCommand.Execute()
 set CmdConn=nothing
end function

'//-------add Command Para---------//
function addCmdPara(Pcmd,pNmae,pType,pIO,pLength,pValue)
 set CommandPara1=Pcmd.CreateParameter(pNmae,pType,pIO,pLength)
 Pcmd.Parameters.Append CommandPara1
 Pcmd(pNmae)=pValue
end function

%>

阅读更多
个人分类: web开发
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

qCon.asp

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭