Solved
Import File into Database With VBA (Indexes and Primary key needed)
Posted on 2001-08-29
I have to import a CSV file into a NEW table.
WITH INDEXES ON THE 2 FIRST FIELDS + AUTONUMBER PRIMARY KEY
Structure:
"BBC PRDB","BBC APOLLO","BBC0011 - ZPRDB ORDERS","75","1000"," "," ","22/06/01","094637","000000","22/06/01","094644","0.13","BBC MEDAS","BBC APOLLO BILLING","FTP OTHER STOCKLEY","ECSD-MEDIS","N","22-JUN-2001 9:46:37","186","627","83","169","931108500","13","12"
If I do this with File, Get External Data, Import, and follow the complete wizard.
Everything is imported OK!
TABLE STUCTURE BECOMES THEN
ID Autonumber Primary Key Indexed No Duplicates
Sender Text 255 Indexed (Duplicates OK)
Receiver Text 255 Indexed (Duplicates OK)
...
If I save this file specification (File - Get External Data, Import, Advanced, Create a Spec and Save AS) to be able to use the VBA language to import:
DoCmd.TransferText acImportDelim, "MS Billing Import Specification", _
"IQ RAW DATA", txtIQBillingFilePath.Value, False
The data is imported OK, but there are NO indexes on sender and receiver.
TABLE STUCTURE BECOMES THEN
ID Autonumber Primary Key Indexed No Duplicates
Sender Text 255 Indexed No
Receiver Text 255 Indexed No
In the import specification I HAVE INDICATED that I want indexes on those 2 fields, but there are none.
Access Version is 97 sr2
Anyone knows why this happens and can think of a solution?
Thanks T