473,406 Members | 2,451 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,406 software developers and data experts.

How to transfer *.dbf (many files)

Hi,
I cant solve my problem, I wish to transer all .dbf files from
directory, into one access table ?
All files have same structure.

Nov 13 '05 #1
4 1598
I have written VBA to transfer but I have many files, now i need to do
SELECT INTO, but how can I make VBA to know the tables name ?
So i would make some loop statement.

Nov 13 '05 #2

Piotr wrote:
I have written VBA to transfer but I have many files, now i need to do
SELECT INTO, but how can I make VBA to know the tables name ?
So i would make some loop statement. From the help file, the following shows how to get a list of files...


Function DbfDir()
Dim MyFile As String

MyFile = Dir("C:\WINDOWS\*.INI")
Do While MyFile <> "" ' Start the loop.
Debug.Print MyFile
' Call Dir again without arguments to return the next *.INI file in the
' same directory.
MyFile = Dir
Loop

End Function
osmethod

Nov 13 '05 #3
follow osmethod's example, but where he has the line
Debug.Print MyFile

that's where you want to change this thing

Function DbfDir()
Dim MyFile As String
Dim rsDAO As DAO.Recordset
set rsDAO =
DBEngine(0)(0).OpenRecordset("MyTAble",dbopentable ,dbappendonly)

MyFile = Dir("C:\WINDOWS\*.INI")
Do While MyFile <> "" ' Start the loop.
rsDAO.AddNew
rsDAO.Fields("FileName") = MyFile
rsDAO.Update '--save the record
' Call Dir again without arguments to return the next *.INI file in the

' same directory.
MyFile = Dir
Loop

rsDAO.Close
set rsDAO=Nothing

End Function

Nov 13 '05 #4
umm... sorry, fingers working faster than my brain...
instead of using AddNew and all that, you can probably just use
something like this:

dim strSQL as string
strSQL = "INSERT INTO xlsToAccess SELECT xlsData.* FROM " & strFile
'which you get from Dir()
DBEngine(0)(0).Execute strSQL, dbFailOnError

and then you just wrap the loop around that whole mess.

Nov 13 '05 #5

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

Similar topics

5
by: Glauco | last post by:
hi to all, i'm planning to make a way to transfer file with python. I would like to make the transfer using some crypto api, to make the channel secure. i don't want to write a wrapper to ftp or...
2
by: Mr Wizard | last post by:
I am going through the front controller http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp and all works well except when the server.transfer...
3
by: RF | last post by:
I have a complete web site running IIS5 with asp.net. I have many projects that I'd like to transfer to a new server IIS6. How can I manage all this transfer from from system to another? ...
3
by: Juande | last post by:
Hello, How can I transfer a file from a remote server (with static IP) to my local machine? Many thanks
38
by: Tom | last post by:
I need my data generating C program on computer #1 to export small amounts of data (one - 40 byte data structure) periodically (once per minute) to a C program on computer #2. I am considering...
10
by: David | last post by:
I have googled to no avail on getting specifically what I'm looking for. I have found plenty of full blown apps that implement some type of file transfer but what I'm specifcally looking for is an...
6
by: MGM | last post by:
Alright, so here's my issue. I have a bunch of .dbf files, about 40 or so by summer's end, I'd say. These dbf files somewhat differ from each other as far as number of columns and data is...
2
yashg
by: yashg | last post by:
I am building a data backup application in C# using Sockets. It has a server component and a client component. The client is going to upload files to the server through TCP sockets. I've got all...
1
by: shyaminf | last post by:
hi everybody! iam facing a problem with the transfer of file using servlet programming. i have a code for uploading a file. but i'm unable to execute it using tomcat5.5 server. kindly help me how to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.