UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Finding the Primary Key after TransferText    
 
   
Shane
post Apr 27 2005, 03:28 AM
Post #1

UtterAccess Veteran
Posts: 403
From: Northern Ireland



I am using TransferText to import a text file into a table. When a new record is created, an autonumber is assigned as the primary key. Is there any easy way I find out what this primary key is? In some of my applications I am using random primary keys and so unfortunately it is not as simple as going to the last record.

Thank you for your time

Shane
Go to the top of the page
 
+
Shane
post Apr 27 2005, 05:06 AM
Post #2

UtterAccess Veteran
Posts: 403
From: Northern Ireland



I think I have a solution.
I have added a timestamp to the table (DateCreated fiels with default set to now()) after I run the transfertext I select the ID field with the highest timestamp which is less than or equal to now().

This seems to work.

Shane
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 25th May 2013 - 04:43 AM