VB and SQL help needed

gmit

Registered User.
Local time
Today, 14:53
Joined
Jan 27, 2004
Messages
23
Hi
Does anybody know of a function or sample code that will tell me the last auto increment id from an insert query. I know of a function 'mysql_insert_id' in php but is there something similar in VB?
 
Problem solved

I used the max(id) to achieve what I wanted:

strSQL = "Select Max(id) as lastID FROM " & strTable
 
Simple Software Solutions

I use this to get the Autonumber form a table that resides in SQL

Set Tbl = MasterDbConn.Execute("Select @@identity As XPropertyID")
LngLoginKey = Tbl.Fields("XPropertyID").Value
 

Users who are viewing this thread

Back
Top Bottom