But when I run the following code I get an error on the .Execute Line, "Type name is invalid". WHat am I doing wrong? Also when I try to use adVarChar in the create Parameter property I get an "Parameter Object is improperly define. Incoonsistant or incomplete information was provided" error
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
techgnome,
Thanks alot for your help, it work like a charm! Now the SPROC is returning 4 records how step through each of the records in the ADODB.Command object similiar to rs.MoveNext in the recordset?
Thanks!
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Steve,
I assumed that the RSObject is a Recordset but it isn't being assigned to the recordset. WHat am I doing wrong?
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Did you change the SPROC to remove the OUTPUT parameters?
Yes
Originally Posted by szlamany
And change the select to no longer fill the variables?
Yes
Originally Posted by szlamany
To test the SPROC you can EXECUTE it in QUERY ANALYZER...
It works fine it returns the appropriate number of records, but my question is how do I access them via code? Is it similiar to a Recordset:
VB Code:
For a = 1 to rs.RecordCount
MsgBox rs.Fields(1).Value
Next a
Thanks
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Ok, I figured out my problem, the rs.RecordCount propert is returning -1 so my For Next loop was failing. Now my next question is how do I submit more than one INV_UNIT:
When I run the SP in the Query Analyzer like this:
VB Code:
Execute GetCasesTeam @InvUnit="Unit A, Unit B, Unit C"
No records are returned but if I do them individually they all return records. I know I am doing something stupid, but what?!?!??
Thanks!
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
WHERE dbo.INCIDENTS.INV_UNIT in('Unit A', 'Unit B', 'Unit C') AND
dbo.INCIDENTS.STATUS in('Active','Suspended')
GROUP BY dbo.INCIDENTS.INV_TITLE
ORDER BY Count(IA_ADM.PRIMARY_CASE_REC.CASENUM);
and then execute it it returns the required records:
VB Code:
Execute GetCasesTeam
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Thanks to all, it is working now, I just needed to submit my query string correctly. Thaks to all again!
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
The -1 form the recordscount is because a server side cursor was being used. -1 is actualy good, it means there are records, we just don't know how many.... three ways around this:
1) use a client side cursor. This will force the recordset to actualy populate itself.
2) "Jiggle the recordset" - a technique I've used inthe past. Do a .MoveLast followed by a .MoveFirst will get the records. After that .RecordCount will be correct
3) Use a while loop instead of a for loop:
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."