Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Calling Stored Procedures in VBS

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1404
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Calling Stored Procedures in VBS
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Calling Stored Procedures in VBS - 9/28/2004 4:00:59 AM   
  hiszorn

 

Posts: 1
Score: 0
Joined: 9/28/2004
From:
Status: offline
I have this code written but I am not sure what else I need. I am getting an error on ADODB.Command that the arguements are incorrect. Does anyone have any experience with this?

Function MyFunction0( )
dim cmdGetVoucher
dim prmIncDec
dim prmVoucherNum
dim prmErrorState

Set cmdGetVoucher = CreateObject("ADODB.Command")
cmdGetVoucher.ActiveConnection = strConn
cmdGetVoucher.CommandText = "GetNextVoucher"
cmdGetVoucher.CommandType = adCmdStoredProc

Set prmIncDec = Command.CreateParameter ("@I_tInc_Dec",adTinyInt, adInput,1, 1)
cmdGetVoucher.Parameters.Append prmIncDec
Set prmVoucherNum = Command.CreateParameter ("@O_vVoucherNumber", adVarChar, adOutput,17)
cmdGetVoucher.Parameters.Append prmVoucherNum
Set prmErrorState = Command.CreateParameter
("@O_iErrorState", adInt,adOutput,5)
cmdGetVoucher.Parameters.Append prmErrorState

cmdGetVoucher.execute
MyFunction0 = prmVoucherNum.value
set cmdGetVoucher = nothing

End Function
 
 
Post #: 1
 
 Re: Calling Stored Procedures in VBS - 9/29/2004 1:10:46 AM   
  d4nclark

 

Posts: 4
Score: 0
Joined: 9/16/2004
From:
Status: offline
The Line
MyFunction0 = prmVoucherNum.value
Should Read
MyFunction0 = cmdGetVoucher.Parameters("@O_vVoucherNumber").value

(in reply to hiszorn)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Calling Stored Procedures in VBS Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts