Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Simple MYSQL VB Question ....

Posted on 2002-06-17
5
Medium Priority
?
205 Views
Last Modified: 2010-05-18
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
Comment
Question by:AndySulz
  • 3
  • 2
5 Comments
 
LVL 2

Author Comment

by:AndySulz
ID: 7085264
FIELD0 IS THE AUTONUMBER FIELD AND FIELD1 IS THE INTEGER(3) COLUMNS
0
 
LVL 2

Accepted Solution

by:
GregJennings earned 200 total points
ID: 7085895
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
 
LVL 2

Author Comment

by:AndySulz
ID: 7086018
i actually figured it out a while ago.... but i will give you the points..
0
 
LVL 2

Expert Comment

by:GregJennings
ID: 7086040
Thanks.  Have you seen the MySQL docs?  They are in HTML in the "docs" folder under the main MySQL folder.
0
 
LVL 2

Author Comment

by:AndySulz
ID: 7086258
i read it at mysql.com
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question