Importing a CSV file not using Tranfer text method

bbrendan

Registered User.
Local time
Today, 10:32
Joined
Oct 31, 2001
Messages
35
Hi All,

Ok this is something im REALLY stuck on.

I have a file which uses the pipe delimiter. The problem is this, I cannot use the docmd.transfer text method as this requires a specification, which I cannot provide as this is a Access ADP, which doesnt allow you to store a spec name.

So, is there a way in vba to do this other than using transfer text????

thanks
 
You can process the file manualy, ie open the file then use sql to add the records to you DB.

I can point you in the right direction.

Look at the vba functions

Code:
OPEN [filename] For [method] as #[filenumber]

and

Code:
line input #[filenumber],[Outstring]

note [Something] is a variable




Hope this helps

ShadeZ
 
Also, the SPLIT function (see the help files) is a good way to take a delimited line, assign it to a single line array and then process the results then have it read the next line.

The benefit of this is that you can read differing lengths of lines and it is extremely easy to parse a delimited string and then use the array (declare as varArray as Variant) and then just use the column numbers (starting with 0) to assign to wherever you need.
 

Users who are viewing this thread

Back
Top Bottom