-
AddNew method in ADO is different than in DAO...
I use a DAO control to access a table in a Access database. The table has
an ID field which is autonumber.
When using the AddNew method in DAO, the ID is generated right away. However,
in ADO it is not generated until the Update method is executed.
Any idea on how can I have the ID value at the time the AddNew method (ADO)
is executed ?
Thanks,
-
Re: AddNew method in ADO is different than in DAO...
Try this Sergio, it seems to work well for me (VB6sp3 ADO2.5)
dim lngNewUID as integer
rs.update
rs.requery
lngNewUID = rs!ID
Good luck
"Sergio Duenas" <sergio_duenas@hotmail.com> wrote:
>
>I use a DAO control to access a table in a Access database. The table has
>an ID field which is autonumber.
>
>When using the AddNew method in DAO, the ID is generated right away. However,
>in ADO it is not generated until the Update method is executed.
>
>Any idea on how can I have the ID value at the time the AddNew method (ADO)
>is executed ?
>Thanks,
>
>
-
Re: AddNew method in ADO is different than in DAO...
Check the cursor, see..
PRB: AutoNumber Field Is Not Incremented When Using ADO
ID: Q190370
Charles Corcoran
"Sergio Duenas" <sergio_duenas@hotmail.com> wrote:
>
>I use a DAO control to access a table in a Access database. The table has
>an ID field which is autonumber.
>
>When using the AddNew method in DAO, the ID is generated right away. However,
>in ADO it is not generated until the Update method is executed.
>
>Any idea on how can I have the ID value at the time the AddNew method (ADO)
>is executed ?
>Thanks,
>
>
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks