Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quick ADO Question
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00627839
Message ID:
00627996
Views:
24
try this:
sql = "set nocount on insert into products (CustomerId) values ('" & iCustNo & "') select @@identity set nocount off"
rs.open sql
msgbox rs(0)
>I want to insert a record into an Access table using:
>
>
>"insert into products (CustomerId) values ('" & iCustNo & "')"
>

>
>Then I want to add order detail items. For this I need to new
>auto-generated Id from the Access table.
>
>After the insert above, there could be many records for the customer,
>so how do I know the Id of the new record?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform