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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error '3265' when executing stored procedure

Status
Not open for further replies.

larrydavid

Programmer
Jul 22, 2010
174
US
Hello,

I have the following sub which executes a stored proc which runs great in SQL Server (2008) QA:

Private Sub StoredProcedureTest()
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cnn = New ADODB.Connection
cnn.ConnectionString = "Provider=SQLOLEDB;Data Source=TESTSERVER;Initial Catalog=TEST;Trusted_Connection=Yes"
cnn.Open
Set rs = New ADODB.Recordset
Set rs = cnn.Execute("EXEC udsp_Insert_Test_Records")
Debug.Print rs(0), rs(1), rs(2)
rs.Close
Set rs = Nothing
cnn.Close
Set cnn = Nothing
End Sub

But, now I am getting:
Run-time error '3265':

Item cannot be found in the collection corresponding to the requested name or ordinal.

I have been researching this and cannot seem to find a definitive reason for this error, especially since I can execute this sp fine in the SQL QA.

Any help greatly appreciated as always.

Thanks,
Larry
 
What are supposed to be rs(0), rs(1), rs(2) ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
OK, I feel totally lame. The error was because of those unnecessary debug statements. But now, I have this:

Debug.Print rs

Which is returning me an error 13 type mismatch error. Is this a type mismatch on one of the values trying to be inserted or the way I've written the stored proc itself?

Sorry if my question seems lame.

Thanks,
Larry

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top