mivc
March 7th, 2006, 03:01 PM
Hello there,
Is there anyone who can tell me how to use the find method of the ADODB.Recordset object to find
parts of a date value.
For example:
I have a grid with a datacontrol which is connected to a database via odbc.
It is possible for the user to sort a column if he clicks on a columnhead, and i will move the recordpointer
to the correct record i he presses a key.
For example:
The grid is sorted on a column which is a date field.
iF the user presses 0, i will go to the first date which begins with 0, if he then presses 1 i will move
to the first date that begins with 01 and so on.
i do this with the following code:
rs is an ADODB.recordset which i have set to the database. To find the correct record i use the following code
rs.find mid(str(fld_date,1,2)) LIKE '01*', , adSearchForward, 1
when i run this i get the following error
runtime error 3001
Arguments are of the wrong type, are out of acceptable range or are in conflict with one another.
if fld_date was a character field it would have worked.
Can someone please help me to solve this problem.
THANKS!!
Is there anyone who can tell me how to use the find method of the ADODB.Recordset object to find
parts of a date value.
For example:
I have a grid with a datacontrol which is connected to a database via odbc.
It is possible for the user to sort a column if he clicks on a columnhead, and i will move the recordpointer
to the correct record i he presses a key.
For example:
The grid is sorted on a column which is a date field.
iF the user presses 0, i will go to the first date which begins with 0, if he then presses 1 i will move
to the first date that begins with 01 and so on.
i do this with the following code:
rs is an ADODB.recordset which i have set to the database. To find the correct record i use the following code
rs.find mid(str(fld_date,1,2)) LIKE '01*', , adSearchForward, 1
when i run this i get the following error
runtime error 3001
Arguments are of the wrong type, are out of acceptable range or are in conflict with one another.
if fld_date was a character field it would have worked.
Can someone please help me to solve this problem.
THANKS!!