sudheerkns
asked on
DoCmd.Transfer text not creating Primary key
I am trying to import a text file into a database table using a specifictaion i created. I was initially using the wizard to do this task. When i have written code to this using VBA, the resultant table created in the accees does not contain the primary key. whereas i specified 'let access decide the primary key when i defined the specification.
There is no problem in generating the primary key when i create the table using the wizrd but when i do it using VBA Acccess simply does not create the primary key
I am using Access 97...
sudheer
There is no problem in generating the primary key when i create the table using the wizrd but when i do it using VBA Acccess simply does not create the primary key
I am using Access 97...
sudheer
Can you paste your vba tabel create code here, please?
ASKER
Call DoCmd.TransferText( _
acImportDelim, _
"Import_Leavers", _
GetFileName(txtLeaversFile Path), _
txtLeaversFilePath _
)
Import_Leaver is a import specification i created
It works fine with wizard but not with code. primary key is not created. :((
acImportDelim, _
"Import_Leavers", _
GetFileName(txtLeaversFile
txtLeaversFilePath _
)
Import_Leaver is a import specification i created
It works fine with wizard but not with code. primary key is not created. :((
According to Microsoft this is a problem:
http://support.microsoft.com/default.aspx?scid=kb;en-us;182002
You will need to import other than using TransferText if you need the primary key.
http://support.microsoft.com/default.aspx?scid=kb;en-us;182002
You will need to import other than using TransferText if you need the primary key.
ASKER
Hi niblick,
thanks for the posting. but then this is a serious problem wiht access. any suggestion on how to overcome this. Microsoft themselves say to avoid using the TransferText in code..
sudheer
thanks for the posting. but then this is a serious problem wiht access. any suggestion on how to overcome this. Microsoft themselves say to avoid using the TransferText in code..
sudheer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks niblick
I was initially doing the same but it was taking too much of time for say 10K records even. It took 10 minutes.
so i explore using the same wizard in code.
intially it was working and now it stopped.
sudheer
I was initially doing the same but it was taking too much of time for say 10K records even. It took 10 minutes.
so i explore using the same wizard in code.
intially it was working and now it stopped.
sudheer
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.