Hi there!

If any of you have tried the following with ASP/ADO and MySQL, please inform
me of how you did it:

I use ASP and adodb.recordset to connect to a MySQL-database.
I use the following code to insert into the db:

[CODE START]
set rsGroup = server.CreateObject("adodb.recordset")
sql = "tblGroup"
rsGruppe.Open sql, connect

with rsGroup
        .AddNew
                .Fields("group_name") = strGName
                .Fields("group_slogan") = strGSlogan
        .Update
end with
[CODE END]

Now - the thing I have to do in the next line is, to get the (auto
incremented, indexed and unique) group_id of the newly inserted group from
tblGroup.

How do I do that? Can I call the last_insert_id() function in MySQL through
the recordset in some way? Or any other suggestions?

When I used Access-databases instead of MySQL, I could just call
rsGroup("group_id") in the next line of code, which would return the correct
group_id.

Please help, anybody!?

Kind regards,
Henrik Mohr, Denmark


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to