LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Insert data into SQL Server db - find out the record number

Hello all,

I'm using the following code to add records to a SQL Server Express database
table using an INSERT statement in the SQL string.

Set cnt = CreateObject("ADODB.Connection")
With cnt
.ConnectionString = connString
.Open
.Execute sqlString
.Close
End With

The table I add data to has an auto-increment Record_No field (Identity
Increment). It is also the primary key. How do I determine this record_no? I
need it to subsequently add data to another table.

Thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need to have a record number change for every record Puget Sound Courier Service Excel Discussion (Misc queries) 1 July 12th 09 03:32 PM
SQL Server -- Bulk Insert from Excel to SQL Server Madhan Excel Discussion (Misc queries) 0 December 12th 06 03:08 PM
find number & insert rows Steve Wallis Excel Programming 4 March 21st 06 05:48 PM
Find end of week and insert Data parteegolfer Excel Programming 5 March 1st 06 03:09 PM
Find match between 2 columns and then record data that is in colum Karl Excel Discussion (Misc queries) 3 December 8th 05 09:56 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"