Hi!

How can I get an idetity field value back after inserting a row into a

table using ADO?

Bojan

Hi!

How can I get an idetity field value back after inserting a row into a

table using ADO?

Bojan

Never mind. I've already found the answer to this question. Thanks for

triing to help anyway.

Tell us about it

>Never mind. I've already found the answer to this question. Thanks for

>triing to help anyway.

Bookmark the new row before .update then return the bookmark, assuming your

using autonumber for your id field

> Hi!

> How can I get an idetity field value back after inserting a row into a

> table using ADO?

> Bojan

> Tell us about it

I'm sorry for not checkig this newsgroup for a while. Here is the exampleQuote:> >Never mind. I've already found the answer to this question. Thanks for

> >triing to help anyway.

code:

Dim r As New ADODB.Recordset

On Error GoTo ErrorHandler

queueConnection.Execute "INSERT INTO t_fw_queue (subscription_id,

fw_command) VALUES (0, '" + cmdText.Text + "')"

fw_command_id DESC", queueConnection

commandID = r("Identity")

r.Close

Bojan

1. Getting back identity after an insert via ADO?

If I have:

table point

(

pt_ident integer identity not null,

pt_x integer,

pt_y integer

)

and I do:

insert point (pt_x, pt_y) values (0, 0)

How do I get the identity back programmatically? I've tried using ADO and

doing:

and the recordset I get back has a single field, and it's a NULL.

On the other hand, if I use isql_w, I can get back the proper value for the

identity.

How do people handle getting the identity back after an insert via ADO?

Thanks.

Chris Sells

http://www.sellsbrothers.com

2. Poor performance with UPPER 9.30uc2, aix

3. Getting Back Identity column value on Insert using RDS

5. Getting SQL server Identity field using ADO

6. ADO connect to AS (please please comment)

7. Insert record specifying IDENTITY using ADO - Help!

8. Can't Start server (Internal NT Error 2140) HELP!

9. Insert vs AddNew - Getting Identity

10. Getting the last @@IDENTITY after cursor insert

11. Getting IDENTITY value BEFORE an insert(?!)

5 post • Page:**1** of **1**