• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

Simple MYSQL VB Question ....

TestTable has 2 columns i is an auto number the other is an integer value table..

If I do
adoconn.execute "Insert into TestTable(FIELD1), Values(123);"

how would i get the autonumber back out of the table?

0
AndySulz
Asked:
AndySulz
  • 3
  • 2
1 Solution
 
AndySulzAuthor Commented:
FIELD0 IS THE AUTONUMBER FIELD AND FIELD1 IS THE INTEGER(3) COLUMNS
0
 
GregJenningsCommented:
Try this:  "select LAST_INSERT_ID();"
It should return a recordset with a single row and single column containing the value last inserted into an AUTO_INCREMENT field for the current connection.
0
 
AndySulzAuthor Commented:
i actually figured it out a while ago.... but i will give you the points..
0
 
GregJenningsCommented:
Thanks.  Have you seen the MySQL docs?  They are in HTML in the "docs" folder under the main MySQL folder.
0
 
AndySulzAuthor Commented:
i read it at mysql.com
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now