dbTalk Databases Forums  

Creating table problem in Access

comp.database.ms-access comp.database.ms-access


Discuss Creating table problem in Access in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
CefiroZ
 
Posts: n/a

Default Creating table problem in Access - 07-02-2004 , 11:27 AM






I need to create a table by importing from a .csv file. The only
problem is I need to create a primary key ID using autonumber, and
this cannot be made a part of the .csv. I tried to create an import
spec that would use autonumber but I can't get that to work. Any
ideas there? My other thought was to just create a table with the
fields I need using CREATE TABLE in SQL and then importing the stuff
from my file into that table. My hang up here is the fact that I
don't know the syntax of that statement for creating a primary key of
the autonumber type. Any help with either of these ideas or perhaps a
different idea? Thanks!

Reply With Quote
  #2  
Old   
Ray
 
Posts: n/a

Default Re: Creating table problem in Access - 07-08-2004 , 10:40 AM






cefiroz32 (AT) hotmail (DOT) com (CefiroZ) wrote in message news:<787264ce.0407020827.759afdbc (AT) posting (DOT) google.com>...
Quote:
I need to create a table by importing from a .csv file. The only
problem is I need to create a primary key ID using autonumber, and
this cannot be made a part of the .csv. I tried to create an import
spec that would use autonumber but I can't get that to work. Any
ideas there? My other thought was to just create a table with the
fields I need using CREATE TABLE in SQL and then importing the stuff
from my file into that table. My hang up here is the fact that I
don't know the syntax of that statement for creating a primary key of
the autonumber type. Any help with either of these ideas or perhaps a
different idea? Thanks!
Hello,

Perhaps what you need to do is to import your CSV file into Access by
using the import wizard and let Access add the Autonumber field. When
you get to the last choice for importing the file, save the import spec at
that time.

Then, make a copy of the final table with NO data, just structure only.

Now, edit the import spec by removing the Record ID - autonumber field
and save it.

Now, use the new import spec and your new table to import your data. This
will create the autonumbers you need while importing our CSV file at the same
time using the spec.

Regards,

Ray


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.