dim sServer, sConn, oConn,oRS, myCommand, adoRec
Const adCmdStoredProc=4
sServer="PT102BESVM01"
sConn="provider=sqloledb;data source=" & sServer & ";initial catalog=BESMgmt"
Set oConn = CreateObject("ADODB.Connection")
Set oCmd = Server.CreateObject("ADODB.Command")
oConn.Open sConn, "username", "password"
Set oCmd.ActiveConnection = oConn
Set oRS =CreateObject("ADODB.Recordset")
oCmd.CommandText="SQLQuery1"
oCmd.CommandType = adCmdStoredProc
oCmd.Execute
'oRS.open sSQL, oconn
'MsgBox sSQL
msgbox oCmd.Parameters(0)
|