Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quick ADO Question
Message
From
04/03/2002 12:41:37
Jason Dalio
Northern Interior Regional Health Board
Prince George, British Columbia, Canada
 
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00627839
Message ID:
00627901
Views:
9
In Access you can get the new number by the following:
rstRecordset.open "SELECT * FROM MyTable WHERE 0 = 1;", cnConnection, adLockOpptomistic

With rstRecordset
   .AddNew 
   !Field1 = txtFirst.Text
   !Field2 = txtSecond.Text
   .Update
   NewAutoNumber = !tblID
End With
This works fine for Access but does not work with SQL so be wary! The WHERE 0 = 1 is there so that you open the conenction but don't bother filling a recorsdet as you are only adding a record.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform