| << | Quit Smoking or you're fired | Blog Of the Week - TWI | >> |
| posted at 13:58:19 By Flipping Heck! | Posted In Coding |
It's taken me ages to find out how to do this (what turns out to be a) relatively simple operation.
Here's the problem. Table 1 has a user_id which is auto incremented by MYSQL. Table 2 has an auto incremented login_id but also requires the user_id. Here's how we get one ID from one table to the other:
objRS.source = "Select LAST_INSERT_ID() from Table1"
objRS.open
LastID = objRS("LAST_INSERT_ID()")
objRS.Close
Simple! We can then refer to the LastID in Table 2
| Click To View Comments (2) | Trackback URL | |
| << | Quit Smoking or you're fired | Blog Of the Week - TWI | >> |





View the Tag Cloud or View the Category Cloud