Error Number # -2147217825 
Author Message
 Error Number # -2147217825

I have a simple search procedure, by name or by ID.  It works fine when I do
the search my name, but I get the above error number when I try to search by
ID.  Here is my code in the txtSearch_Change sub:

    xSeek = txtSearch.Text + "*"
    If optOrder(0).Value = True Then        ' Search by EmployeeID
        xSeek = "Employeeid like '" & xSeek & "'"
    End If
    If optOrder(1).Value = True Then        ' Search by LastName
        xSeek = "LastName like '" & xSeek & "'"
    End If

    Adodc2.Recordset.Find xSeek, 0, adSearchForward

Help please!

Thank you,

Phuong



Sun, 14 Jul 2002 03:00:00 GMT  
 Error Number # -2147217825
If your ID is a numeric field, you cannot apply Like option which works only
with string type fields.


Sun, 14 Jul 2002 03:00:00 GMT  
 Error Number # -2147217825
the wildcard for ADO is % not *.  Does this fix your problem?


Quote:
> I have a simple search procedure, by name or by ID.  It works fine when I
do
> the search my name, but I get the above error number when I try to search
by
> ID.  Here is my code in the txtSearch_Change sub:

>     xSeek = txtSearch.Text + "*"
>     If optOrder(0).Value = True Then        ' Search by EmployeeID
>         xSeek = "Employeeid like '" & xSeek & "'"
>     End If
>     If optOrder(1).Value = True Then        ' Search by LastName
>         xSeek = "LastName like '" & xSeek & "'"
>     End If

>     Adodc2.Recordset.Find xSeek, 0, adSearchForward

> Help please!

> Thank you,

> Phuong



Sun, 14 Jul 2002 03:00:00 GMT  
 Error Number # -2147217825
Thanks for replying!

Yes, my ID field is an integer field.  So, how do I search on the numeric
field?  I'm just a VB beginner, help please!

Thanks,

Phuong


Quote:
> If your ID is a numeric field, you cannot apply Like option which works
only
> with string type fields.



Sun, 14 Jul 2002 03:00:00 GMT  
 Error Number # -2147217825
Phoung,

xSeek = "Employeeid = " & intMyNumber
or:
xSeek = "Employeeid BETWEEN " & intMyLowLimit & " AND " & intMyHighLimit

HTH    PerL


Quote:
> Thanks for replying!

> Yes, my ID field is an integer field.  So, how do I search on the numeric
> field?  I'm just a VB beginner, help please!

> Thanks,

> Phuong



> > If your ID is a numeric field, you cannot apply Like option which works
> only
> > with string type fields.



Sun, 14 Jul 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Error Number # -2147217825

2. Custom error numbers - which numbers to use?

3. Error Number : 70 and Error Description : Permission Denied

4. Error Handler -- Getting Line Number of error

5. Error Handler - How to get line number where error occurred

6. On Error Resume Next (but Only with Specific Error, like Err.Number = 70)

7. Automation Error(Error Number:-2147023169)

8. Error Numbers error

9. Overflow error, error number 6, in VB6 using Crystal Reports 7

10. No Error or ERL number returned in error trap

11. Automation Error (Error Number 80004005)

12. Run-time Error number 2486

 

 
Powered by phpBB® Forum Software