ASP, SQL Server 6.5, VBScript, HELP!!! 
Author Message
 ASP, SQL Server 6.5, VBScript, HELP!!!

Hello everyone,

I'm having a real problem with a "simple" VBScript.  I want to execute a
stored procedure that takes a parameter.  I'm learning ADO and VBScript
(coming from Java land) and I would like to execute "sp_spaceused authors"
on the pubs database on SQL Server 6.5.  When I run SQL Trace, I connect to
the database, pass the stored procedure, and execute it.  The problem is
that the parameter, in this case "authors", is not being appended to the
stored procedure.  Essentially, all that is executed is "sp_spaceused".  My
question is, what the heck am I doing wrong?  My code is below.  I apologize
if this post is inappropriate for this newsgroup, I'm new.

Thanks,
Damon Torgerson
Oh yeah, I'm using IIS 4.0 if that matters.

odbc_driver = "DRIVER={SQL Server};SERVER=DAMONT_SRV;UID=sa;APP=Microsoft(R)
Windows NT(TM) Operating _

System;WSID=DAMONT_SRV;LANGUAGE=us_english;DATABASE=pubs"

' establish connection to the database
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open odbc_driver,"sa",""

' set up the stored procedure
Set banCardCommand=Server.CreateObject("ADODB.Command")
Set banCardCommand.ActiveConnection=Conn
banCardCommand.CommandType=adCMDStoredProc
banCardCommand.CommandText="sp_spaceused"

' set up the parameter to be passed to the stored procedure
txCCNum = "authors"
Set prm=banCardCommand.CreateParameter("Test", adVarChar, adParamInput, 92,
txCCNum)
banCardCommand.Parameters.Append prm
Set prm=nothing

' execute stored procedure
Set RS = CreateObject("ADODB.RecordSet")
Set RS = banCardCommand.Execute()
while not RS.EOF
    Response.Write(RS("rows"))
    Response.Write("Hello")
    RS.MoveNext
wend

' close connections
banCardCommand.Close
Conn.Close



Wed, 19 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. querying sql server 6.5 in asp page

2. VBScript Error due to converting databases from Access to SQL Server 6.5

3. USing ASP migrating from SQL 6.5 to SQL 7.0

4. Help with SQL Server 6.5

5. Help upsizing from FoxPro to SQL Server 6.5

6. Help!- SQL Server 6.5 table is read only!

7. Help SQL SERVER 6.5/VB 5.0

8. INTERNATINAL SETTINGS PROBLEM WITH SQL SERVER 6.5 ......PLEASE HELP

9. HELP! SQL Server 6.5/ADO2/VB6 Question

10. HELP!!! RDO and SQL Server 6.5

11. Need help Access 97 vs SQL Server 6.5?

12. Need help on VBSQL sourcing of SQL SERVER 6.5

 

 
Powered by phpBB® Forum Software