Re: Need some help with MOVENEXT/MOVEPREVIOUS
- From: argusy <argusy@xxxxxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 21:44:46 +1030
John
Your database has only one record with '123' in MYFIELD That's why opening the database then opening a recordset query works. The movenext also works because it is moving to the end-of-file marker of the created recordset Note I wrote --marker---. The end-of-file is actually a dummy or false record, but with no data. That's why the failure - it's now NOT a current record (it's beyond the EOF marker)
I'm making a couple of assumptions It's an access database you want the recordset to start with MYFIELD at '123' you want the remainder of the table. In that case, your query should be "SELECT * WHERE MYFIELD => '123'".
Since your query DOES extract one record, MYFIELD's type is a string. Open your database in access and do a sort on MYFIELD. See how the numbers are sorted Then you'll see why you should be careful when using a string field to store numbers, and what you may get in a recordset mightn't be what you have expected
Also go to the last (blank) "record". It's not a record until you put something into any field. Once you do, another "record" is created on the next line. That should also give you a clue as to why you're getting the error message
I'm not going to ask you why are you transferring the data to another table That's like opening Pandora's box
Argusy
John wrote:
Hi,
I'm building an application, using DAO with VB6 (sp6) and I encountered the following problem:
I open a recordset (rs), select a record by using e.g. SELECT * WHERE MYFIELD="123".(placed in a string)
This works, I get the record. (db contains 640 records, the select retreives the third record) I use a routine that places all the fields into a table recordtype. Doing the select and the routine, the table is filled with the requested record.
Thereafter I do a rs.MoveNext and I try to retrieve the fields, but than the error that there is no current record occurs.
So, the sequence is:
1) open db and recordset
2) select the record by using a search argument (lets say to set a certain starting point)
3) than a movenext to obtain the next record
4) using the record fields by placing them in a table
5) close the rs and db
1 and 2 works fine
3 seems to work, no error occurs
4 gives the error: No current record
abort of the routine
Can anyone help me, please?
Regards, John
.
- Follow-Ups:
- Prev by Date: db does not save all 3 tables - DAO 3.6 & SQL
- Next by Date: Re: Need some help with MOVENEXT/MOVEPREVIOUS
- Previous by thread: db does not save all 3 tables - DAO 3.6 & SQL
- Next by thread: Re: Need some help with MOVENEXT/MOVEPREVIOUS
- Index(es):
Relevant Pages
|
Loading