|
-
Oct 20th, 2000, 01:03 PM
#1
Thread Starter
Addicted Member
Hello!
I have kind an annoying problem .
The thing is that I have in my DB table field which is AutoNumber. And in that table I add another record. Is there any other way to retrieve that field's value without loading whole recordset, because I need that number for adding it to other records in some other tables that are referencing to just added record.
Any suggestions?
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Oct 20th, 2000, 01:11 PM
#2
try this:
Code:
dim db as database
dim rs as recordset
dim num as long
set db = opendatabase("my database")
set rs = db.openrecordset("my table")
if not rs.eof then
rs.movelast
num = rs.field
set rs = nothing
-
Oct 20th, 2000, 01:16 PM
#3
Thread Starter
Addicted Member
Yes, but I still have to reopen recordset.
I'd like to know if there is any way to retrieve field value without reloading whole recordset.
Any ideas?
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Oct 20th, 2000, 01:17 PM
#4
Thread Starter
Addicted Member
Oh, I forgot to tell: I'm using DataEnvironment
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Oct 20th, 2000, 01:23 PM
#5
perhaps run a query on that field only
and have it return one record in a
descending order, this will give you the last
record
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|