I'm trying to rewrite an old VB6 application in VB.NET. My old VB6 routine used to detect when a text file was placed in a folder and then it would import that delimited text file into an Access database.
The old way of doing this doesn't work. I thought the way I would handle this is to use a FileSystemWatcher to run the import routine when the text file was detected in the import folder.
I haven't figured out how to use this control properly yet despite finding some code and examples on the Internet.
My major concern is that I can't seem to find anything on importing delimited files into Access via VB.NET.
Does anyone know of any good web sites or samples that they can point me to?
The VB6 code I used to use is
Thanks
The old way of doing this doesn't work. I thought the way I would handle this is to use a FileSystemWatcher to run the import routine when the text file was detected in the import folder.
I haven't figured out how to use this control properly yet despite finding some code and examples on the Internet.
My major concern is that I can't seem to find anything on importing delimited files into Access via VB.NET.
Does anyone know of any good web sites or samples that they can point me to?
The VB6 code I used to use is
Code:
Open ImportDataFile For Input As 1 'import selected text file
While Not EOF(1) 'loop through datafile
Line Input #1, strTemp 'capture data line by line
ImportString = ImportString & strTemp 'ImportString is now a valid record
ImportString = Replace(strTemp, "'", "''") 'counteracts problems with apostrophe's
fitemarray = Split(ImportString, "!") 'split the record into fields
f1 = "'" & fitemarray(0) & "'" 'Invoice No
f2 = "'" & fitemarray(1) & "'" 'Invoice Line
etc...