Problem determining new autonum value after UPDATE before UPDATEBATCH
From: Scott M (scottm1100_at_yahoo.com)
Date: 07/27/04
- Next message: JM: "OracleClient.OracleDataReader dataGrid"
- Previous message: Victor Koch: "Re: SQL SERVER 2000 Errors vi ADO OLDB"
- Next in thread: Val Mazur: "Re: Problem determining new autonum value after UPDATE before UPDATEBATCH"
- Reply: Val Mazur: "Re: Problem determining new autonum value after UPDATE before UPDATEBATCH"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Jul 2004 14:32:05 -0700
Using ADO 2.6 in VBA (Access 2002):
I need to know how to determine the value of the autonum field after issuing
an update statement within a batch transaction. Ex:
Dim An = Integer ' Autonumber value
Rst.open sql, cnn, adOpenDynamic, adLockBatchOptimistic
Rst.Addnew
Rst.Fields(1)=bla
Rst.Fields(2)=bla
Rst.Update
An=Rst.Fields(0) <---- returns a blank or null value
Rst.Addnew
Rst.Fields(1)=bla
Rst.Fields(2)=bla
Rst.Update
An=Rst.Fields(0) <---- returns a blank or null value
Rst.UpdateBatch
An=Rst.Fields(0) <---- returns autonum value of last record updated
How can I read the value of fields(0) (my autonum) prior to issuing the
UpdateBatch?
Your help is greatly appreciated.
Scott
- Next message: JM: "OracleClient.OracleDataReader dataGrid"
- Previous message: Victor Koch: "Re: SQL SERVER 2000 Errors vi ADO OLDB"
- Next in thread: Val Mazur: "Re: Problem determining new autonum value after UPDATE before UPDATEBATCH"
- Reply: Val Mazur: "Re: Problem determining new autonum value after UPDATE before UPDATEBATCH"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|