Filter of ADO Recordset causing run-time error 3265 
Author Message
 Filter of ADO Recordset causing run-time error 3265

I'm trying to do a filter of a ADO recordset object, and for some reason
I'm always
getting a run-time error: 3265 when I do (can't find item or ordinal
value
in collection).  Here is my code:

Private Sub Form_Load()
  Dim strSQL As String

  strSQL = "SELECT * FROM TAB_Contract_Options"
  Set rstOptions = New Recordset
  rstOptions.Open strSQL, "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Contracts.mdb;Persist
Security Info=False", adOpenKeyset, adLockPessimistic

  '   !! error is occurring on this line  !!  :
  rstOptions.Filter = "Contract_Number = 'F08635-98-C-0008'"

  grdOptions.DataSource = rstOptions

End Sub

Anyone know what I'm doing wrong?  This is really holding me up.
Thanks!!

Kevin



Sun, 07 Jul 2002 03:00:00 GMT
 Filter of ADO Recordset causing run-time error 3265

This was my mistake: I used the wrong name of the field.  Apparently, you
get run-time error 3265 when that happens.  It was a really stupid mistake
on my part.

Quote:

> I'm trying to do a filter of a ADO recordset object, and for some reason
> I'm always
> getting a run-time error: 3265 when I do (can't find item or ordinal
> value
> in collection).  Here is my code:

> Private Sub Form_Load()
>   Dim strSQL As String

>   strSQL = "SELECT * FROM TAB_Contract_Options"
>   Set rstOptions = New Recordset
>   rstOptions.Open strSQL, "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\Contracts.mdb;Persist
> Security Info=False", adOpenKeyset, adLockPessimistic

>   '   !! error is occurring on this line  !!  :
>   rstOptions.Filter = "Contract_Number = 'F08635-98-C-0008'"

>   grdOptions.DataSource = rstOptions

> End Sub

> Anyone know what I'm doing wrong?  This is really holding me up.
> Thanks!!

> Kevin

--
===============================
Kevin D. Ruggiero
Applications Developer   Comptek Amherst Systems, Inc.
TEL: (716) 515-4950  ext. 595  FAX: (716) 631-2027



Mon, 08 Jul 2002 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Run-time error '3265': when setting the Sort property of an ADO Recordset

2. Run time error 3265

3. Run-time error '3265': Item not found in this collection

4. Run-time error '3265': Item not found in this collection

5. Run time error 3265

6. Run-time error '3265'

7. Run Time Error 3265 question

8. temp table in a sp cause VB ADO's err 3265

9. Error 3265 Issuing AddNew() to dynamic recordset

10. ADO causes run-time error

11. problem with reading XML into stream from a Command- runtime error 3265

12. ADO error 3265


 
Powered by phpBB® Forum Software