How to link semicolon separated file

G

Guest

Hi all,
I'm trying to link a csv table where field are separate by semicolons.
The problem is that in the linked table all data are in one field.

This is the code:

Dim tblDef As DAO.TableDef
' Open a Microsoft Jet database to which you will link a table.
Set tblDef = CurrentDb.CreateTableDef(tableName)
tblDef.Connect = "Text;FMT=Delimited;HDR=NO;DATABASE=" & strPath
tblDef.SourceTableName = strFile
CurrentDb.TableDefs.Append tblDef

What's wrong?
I'm using Access 2002 sp2
Any help would be appreciated.
Thank you. Bye.

Valentina
 
G

Guest

I guess you are missing an extra parm in > tblDef.Connect =
"Text;FMT=Delimited;HDR=NO;DATABASE=" & strPath
which is indicating the delimiter to be used.

What i should do is have it linked from the File>Import menu
untill you het the proper result and then i would read the connect property
form this table.

?TableDefs(Tablename).connect

- Raoul
 
G

Guest

Raoul, thank you for your reply.
I've already done it. This is the result:

Text;DSN=TABLE Link
Specification;FMT=Delimited;HDR=NO;IMEX=2;CharacterSet=437;DATABASE=C:\Access\Application.

I've tryed with this specifications but the result is the same.
Is there a parameter to specify delimiter char?
 
G

Guest

I've found the trick:
I keep a kind of template of the file that I have previously linked manually.
When user select another file to be linked, I rename it as the template file.
Then the table is linked to the new file contains its data.

It's a workaround, I know... but it works!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top