what i'm doing wrong? 
Author Message
 what i'm doing wrong?

i have error 3021 at movelast line

Sub cmdGo_Click()
    Dim dbs As Database, rst As Recordset
    Dim strSQL As String

    ' Devuelve una referencia a la base de datos activa.
    Set dbs = CurrentDb
    strSQL = "SELECT * FROM PRODUCTOS WHERE [CODIGO PRODUCTO] LIKE '2%'"
    Set rst = dbs.OpenRecordset(strSQL)
'in the movelast line i have this error
'error 3021
'i have in the table more than one record starting with 2
    rst.MoveLast
    Debug.Print rst.RecordCount
    rst.Close
    Set dbs = Nothing
End Sub

  thanks
    be good
      take care
        the force be with you



Mon, 28 Jan 2002 03:00:00 GMT  
 what i'm doing wrong?
The recordset contains no records, since '%' is not a Jet wildcard
character. You are trying to select those records where CODIGO PRODUCTO is
2% - use
  strSQL="SELECT * FROM PRODUCTOS WHERE [CODIGO PRODUCTO] LIKE '2*'"
instead.

Simon Lewis

% is not a wildcard character, so LIKE '2%'

Quote:

>i have error 3021 at movelast line

>Sub cmdGo_Click()
>    Dim dbs As Database, rst As Recordset
>    Dim strSQL As String

>    ' Devuelve una referencia a la base de datos activa.
>    Set dbs = CurrentDb
>    strSQL = "SELECT * FROM PRODUCTOS WHERE [CODIGO PRODUCTO] LIKE '2%'"
>    Set rst = dbs.OpenRecordset(strSQL)
>'in the movelast line i have this error
>'error 3021
>'i have in the table more than one record starting with 2
>    rst.MoveLast
>    Debug.Print rst.RecordCount
>    rst.Close
>    Set dbs = Nothing
>End Sub

>  thanks
>    be good
>      take care
>        the force be with you



Mon, 28 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. What i'm doing wrong?

2. what I'm doing Wrong

3. Can't figure out what I'm doing wrong. Check to see if last character is a /

4. Does anyone know what I'm doing wrong?

5. Help... What I'm doing wrong?

6. Does anyone know what I'm doing wrong?

7. can anyone tell me what i'm doing wrong???

8. Can someone tell me what I'm doing wrong?

9. Obviously I'm doing something wrong!

10. ADO thinks DBMS is done, but DBMS ain't done

11. Recordset: What am I doing wrong?

12. What am I doing wrong??

 

 
Powered by phpBB® Forum Software