Command. asp
<%
Dim Conn, cmd
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open "provider = sqloledb.1; Data Source = (local); User ID = sa; Password =; initial catalog = pubs"
Set cmd = server. Createobject ("ADODB. Command ")
'----- Properties of the command object -----
Cmd. activeconnection = Conn
Cmd. commandtext = "reptq1"
Cmd. commandtimeout = 30' default value: 30 seconds
Cmd. commandtype = 1'. Use + 128 if no return value is returned.
Cmd. commandtype = 2
Cmd. commandtype = 4
Cmd. Prepared = true
'----- Method of command object -----
Dim rs
Set rs = cmd. Execute (, 1)
'Set rs = cmd. Execute (, 2)
Set rs = cmd. Execute (, 4)
Dim param (0)
Param (0) = cmd. createparameter ("percentage", 3, 1, 30) 'adinteger: 3 adparaminput: 1 adparamoutput: 2
Cmd. commandtext = "byroyalty"
Set rs = cmd. Execute (, Param, 4)
'----- test statement -----
dim I
response. write ("
") for I = 0 to Rs. fields. count-1 response. write ("
" & RS (I ). name & " | ") next response. write ("
") do while not Rs. EOF response. write ("
") for I = 0 to Rs. fields. count-1 response. write ("
" & RS (I) & " | ") next response. write ("
") Rs. movenext loop Rs. close set rs = nothing Conn. close set conn = nothing %>