473,396 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

More question on Data Auto Import (??)

Dan
I tried the following code to import a series of data files into an
Access table, but i keep getting Syntax errors. I'm running it from a
Macro using the RunCode action with the ImportFiles() function. Can
someone give me a pointer on how to correct this. Thanks in advance.

Code:
Function ImportFiles()
Dim strPath As String
Dim strFile As String

strPath = "C:\Database\"
strFile = Dir$(strPath & "*.txt")
Do While Len(strFile) > 0
TransferText (acImportDelim, "SampleData3import", "MyTable",
strFile, True)
\\i tried with DoCmd.TransferText as well, with no luck

strFile
strFile = Dir$
Loop
End Function
Nov 12 '05 #1
1 1569

"Dan" <da*******@hotmail.com> skrev i melding
news:11*************************@posting.google.co m...
I tried the following code to import a series of data files into an
Access table, but i keep getting Syntax errors. I'm running it from a
Macro using the RunCode action with the ImportFiles() function. Can
someone give me a pointer on how to correct this. Thanks in advance.

Code:
Function ImportFiles()
Dim strPath As String
Dim strFile As String

strPath = "C:\Database\"
strFile = Dir$(strPath & "*.txt")
Do While Len(strFile) > 0
TransferText (acImportDelim, "SampleData3import", "MyTable",
strFile, True)
\\i tried with DoCmd.TransferText as well, with no luck

strFile
strFile = Dir$
Loop
End Function


Hi
Download textimport.exe
http://support.microsoft.com/default...NoWebContent=1
with samples of how to do this.

Sigurd
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: porterboy | last post by:
Hi Folks, I have auto-completion set up in my python interpreter so that if I hit the tab key it will complete a variable or a python command*. eg. if I type >>> imp and if I then hit the tab...
0
by: Girish | last post by:
Hi Here is the STEPS/METHOD my service provider sends the calling customer numbers captured : Export Method - HTTPS 1. The partner provides Who's Calling with a URL address to direct the data...
0
by: G R | last post by:
Hi Here is the STEPS/METHOD my service provider sends the calling customer numbers captured : Export Method - HTTP 1. The partner provides Who’s Calling with a URL address to direct the data...
1
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous messagebut i'm getting error messages. Here's my...
4
by: Steve Jorgensen | last post by:
I'm restarting this thread with a different focus. The project I'm working on now id coming along and will be made to work, and it's too late to start over with a new strategy. Still, I'm not...
0
by: DataFreakFromUtah | last post by:
Hello! No question here, just a procedure for the archive. Search critera: count records imported count data imported count number of rows imported count number of records imported record import...
2
by: Greg Strong | last post by:
Hello All, I've written code in a test database with test data. Everything seems to be working except compact database in VB code per http://www.mvps.org/access/general/gen0041.htm. The reason I...
3
by: sparks | last post by:
They have a new data collection station. The people here are using access 97.... This third party site will only post data back to us when we do this. ...
3
by: Mark Urish | last post by:
Is there a way to import data from an unmanaged dll? For example, unmanaged.dll: __declspec(dllexport) int unmanagedErrno; managed.cs: class Managed { //this doesn't work:
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.