Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Recordset

Status
Not open for further replies.

ofsouto

Programmer
Apr 29, 2000
185
BR
When I try to list records from a recordset that execute a Stored Procedure(show records from a temporary table - global or local), error message shows up.<br><br>VB Code:<br><br>Dim conn as New ADODB.Connection<br>Dim cmd as New ADODB.Command<br>Dim rs as New ADODB.Recordset<br>Dim strConnection as string<br><br>strConnection = &quot;Provider=SQLOLEDB;Data Source=XXXXX;Initial Catalog=DBDBDB&quot;<br><br>conn.Open strConnection <br><br>Set cmd.ActiveConnection = conn<br>cmd.CommandType = adCmdText<br>cmd.CommandText = &quot;Execute SP_Teste&quot;<br><br>Set rs.ActiveConnection = conn<br>rs.CursorLocation = adUserServer<br>rs.CursorType = adOpenStatic<br>rs.Open cmd<br><br>Stored Procedure Script:<br><br>Create Procedure SP_Test<br>as<br>Select *<br>into ##tmp_Test<br>from tbTest<br><br>Select * from ##tmp_Test<br><br>drop table ##tmp_Test<br><br>return 0<br><br>Are there erros on this code? Could you help me? I can't count records (recordcount) or show results from the recordset above.<br><br>Sincerely<br><br>ofsouto<br>Brazil
 
I hate ADO<br>Give me back the old way.<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Can you say &quot;<FONT FACE=monospace><b>Select * from ##tmp_Test</font></b>&quot; in a stored procedure?<br><br>I would have thought you had to say &quot;<FONT FACE=monospace><b>Select COL, COL1 Into V, V1</font></b>&quot;... etc<br><br>Regards<br> <p>Mike<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>Please don't send me email questions without posting them in Tek-Tips as well. Better yet -- Post the question in Tek-Tips and send me a note saying "Have a look at so-and-so in the thingy forum would you?"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top