473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Getting Values from Stored Procedure

rrocket
116 100+
I currently have this that sends a value to the DB and should return the information I need:

Expand|Select|Wrap|Line Numbers
  1. Set RS = createobject("ADODB.Connection")
  2. Set x1 = server.CreateObject("ADODB.Command")
  3.     With x1
  4.     .ActiveConnection = gObjConnect
  5.     .CommandType = adCmdStoredProc
  6.     .CommandText = "s_FRCWP_OpenSPInvoiceList"
  7.     .Parameters.Append  .CreateParameter("@DirectoryId", adInteger,adParamInput,,94)    
  8.     .Execute
  9.     End With
But when I try to get the value with something like this:
Expand|Select|Wrap|Line Numbers
  1. formString = formString & "<td><input type=""checkbox"" value="""&RS("Transaction_ID")&"""></td>"
I get a "Wrong number of arguments or invalid property assignment" error. Now I know I am not doing something right, but I cannot figure out what it is. Any help would be appreciated.
Apr 15 '08 #1
4 2220
rrocket
116 100+
I actually got it to return one row when I changed the "Set RS = createobject("ADODB.Connection")" to "Set RS = createobject("ADODB.Recordset")", but it gives me an error when I check for EOF try to use RS.MoveNext... Any ideas on how to get it to work?
Apr 15 '08 #2
DrBunchman
979 Expert 512MB
Hi rrocket,

Are you trying to return a record set from the database or just a single return value from the stored procedure?

If you're using the record set then you have created a record set object but not assigned anything to it (which is why using RS("Transaction_ID") won't work).

If you are just returning a single value then this needs to be the first item in your parameter list and it needs to have a parameter type of adParamReturnValue.

Take a look at this. It's got some good examples and explanations of stored procedures which should give you enough info to fix your code.

If you need any more help then let me know.

Dr B
Apr 15 '08 #3
rrocket
116 100+
Thanks for your help... I actually changed the RS value to "Set RS = server.createobject("ADODB.Recordset")", but keep getting an error when I try to use MoveNext, EOF, or BOF.... I am trying to return a list of things and am currently getting the first record, but that is it.

Here is the error:
Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'MoveNext'

I have been searching for a solution and have not been able to find anything.
Apr 15 '08 #4
rrocket
116 100+
I finally figured it out... I commented the changes below.

Here is the problem section:
Expand|Select|Wrap|Line Numbers
  1. Set x1 = server.CreateObject("ADODB.Command")
  2. 'Set RS = server.CreateObject("ADODB.Recordset") 'commented out and made change below
  3.     With x1
  4.     .ActiveConnection = gObjConnect
  5.     .CommandType = adCmdStoredProc
  6.     .CommandText = "StoredProcName"
  7.     .Parameters.Append  .CreateParameter("@Customer_ID", adInteger,adParamInput,,session("UserLocationId"))    
  8.     set RS = .Execute 'Was RS = .Execute
  9.     End With
  10.  
Apr 15 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Golawala, Moiz M (GE Infrastructure) | last post by:
Hi All, Could someone please help me with an issue I am having. I am having problem returning values from a Stored Procedure that creates a dynamic table (table variable) inserts values during a...
3
by: Vipul Pathak | last post by:
Hello Friends ! I have the Following Code, that Executes a Stored Procedure and Attempt to read a Returned Integer Value from the StoredProc. But It gives Error ... ADODB.Command (0x800A0BB9)...
4
by: Amy | last post by:
Hello, I've been struggling to learn C#.NET for a while now. I've made some progress, but I'm easily stumped. :( What's stumping me today is this: I've got a stored procedure (SQL) that...
4
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and...
7
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL...
2
by: Patrick Olurotimi Ige | last post by:
When i run the code below with stored proc :- I get only the first table results :-"templates" even if i fill the dataset with another table for example category,pages etc.. Any ideas? ...
1
by: imranabdulaziz | last post by:
Dear All, I am using sql2005. i am writing stored procedure to save various master data . I recognize master by @type (input verible) and assign it to @mst veriable then based on @mst no I...
3
by: senthilnova | last post by:
hi all i have c# class which calls a stored procedure having insert,update and delete method (using if to switch between them). when i call the SP to EXECUTENONQUER() there is no response from...
1
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
1
by: mohit1286 | last post by:
my stored procedure in db2 is---> create procedure temp_bill(in UPC_cd character(6)) language sql begin declare prod_cd character(8);declare prod_desc varchar(30);declare discount...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.