ADO VBScript Active X

  • I use this script to load records from one store procedure, but after executing, we could only get one row ( the result must be 3 rows). I don't know what happened, please help me.

    Here is the script.

    Const adOpenStatic = 3

    Const adLockOptimistic = 3

    Const adCmdStoredProc = 4

    Set cnCerner = CreateObject("ADODB.Connection")

    cnCerner.ConnectionString ="PROVIDER=SQLOLEDB.1;SERVER=.;UID=proteluser;PWD=;DATABASE=protel;"

    cnCerner.Open

    set cmd = CreateObject("ADODB.Command")

    Set objADORS = CreateObject("ADODB.Recordset")

    With cmd

    .ActiveConnection = cnCerner

    .CommandType = adCmdStoredProc

    .CommandText = "sp_List_CheckOut"

    .Parameters.Refresh

    Set objADORS = .Execute()

    End With

  • What does the ouptut from the stored proc look like in Query Analyser?  Is it a single result set of 3 rows or 3 result sets of a single row each?

    Also, be aware that SQL Server will look in the MASTER database first for procedures that start sp_ (as yours does) and will slow performance.

     

    J

  • can you post your script?


    Everything you can imagine is real.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply