Command. asp

Source: Internet
Author: User

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 (" ") next response. write (" ") do while not Rs. EOF response. write (" ") for I = 0 to Rs. fields. count-1 response. write (" ") next response. write (" ") Rs. movenext loop Rs. close set rs = nothing Conn. close set conn = nothing %>
" & RS (I ). name & "
" & RS (I) & "

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.