473,625 Members | 3,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need code to import files

Hello,

I have a directory on my company network that contains multiple
directories that each hold different files, some are dbf files and some
are xls files. I need my Access 2000 users to be able to click an
Import File button on a form and then a list of the multiple
directories would appear and they could open the particular directory
they want and double click on whichever dbf or xls they need and it
would automatically import. I have been looking for some code to do
this but haven't found exactly what I need. I would appreciate any help
that can be given.

Nov 13 '05 #1
4 1739
umm... Ken Getz's OpenSaveFile API at AccessWeb is your friend.
Then pass the result to whatever your import routine is...
Happy coding.

Nov 13 '05 #2
Farina wrote:
Hello,

I have a directory on my company network that contains multiple
directories that each hold different files, some are dbf files and some
are xls files. I need my Access 2000 users to be able to click an
Import File button on a form and then a list of the multiple
directories would appear and they could open the particular directory
they want and double click on whichever dbf or xls they need and it
would automatically import. I have been looking for some code to do
this but haven't found exactly what I need. I would appreciate any help
that can be given.


I don't have the solution but I do have a couple questions.

Is using the built-in Import function out of the question?

Assuming the answer to the first question is "no", do all the .xls files
have a layout that can be "automatica lly" imported without any tweaking?
If you have worked with importing .xls (I have not worked with .dbf)
you probably know that there are things to consider at import time,
e.g., which worksheet(s) to import, first row contains column
headings?, table name to create, which column(s) to index, what to do
about primary key, etc.

Just a thought.
--
Smartin
Nov 13 '05 #3
Thanks for responding. I had not considered using the built-in Import
function. A friend mentioned that I needed to use the Dir Function. All
the .xls and .dbf files will be different, but will only be one
worksheet and the first row will always be the headings. I would like
to be able to give the table a name upon import. There is no concern
about the index so whatever works. There is a company_id that will
always be used as the primary key.

Nov 13 '05 #4
Your best bet (from the limited information you've given) is probably
to create an import specification, name it, and then use it in your
loop that imports all the files. Look around the NG for examples of
DIR and that should get you going. You essentially throw in a
TransferSpreads heet command inside the loop, and away you go.

Nov 13 '05 #5

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

Similar topics

10
3089
by: Jeff Wagner | last post by:
I am in the process of learning Python (obsessively so). I've been through a few tutorials and read a Python book that was lent to me. I am now trying to put what I've learned to use by rewriting that Numerology program I wrote years ago in VB. There are times I am totally stuck (for instance, I just had an idea to put the numerical values of the alphabet and months of the year in a dictionary located in a function. Then, I can import the...
4
5372
by: Active8 | last post by:
I did this once and can't remember how <blush> so I read the reportlab user guid. It says to unzip the reportlab archive - this is on w2k, BTW, with Python23 - to a directory and make a file called reportlab.pth in the pythod dir. The only line in this file is supposed to be the path to the reportlib dir. Then I'm instructed to open the ... ok I'll close and reopen ... the python cmd line interpreter and type import reportlab
5
1720
by: yvan | last post by:
Approximately once a month, a client of ours sends us a bunch of comma-delimited text files which I have to clean up and then import into their MS SQL database. All last week, I was using a Cold Fusion script to upload the cleaned up files and then import the records they contained into the database, though obviously, the process took friggin' forever, and could have been done 500x quicker had I done it directly on the server. My SQL...
1
1969
by: LenS | last post by:
If this is the wrong place to post this, please advise better place. Otherwise, I have created the following python program and it works. Running on XP. I think I am now at that stage of learning python where I'm not quit a newbie and I am not really knowlegable. I know just enough to be dangerous and can really screw things up. Any suggestion on improving would be greatly appreciated. However my real question is I would like to run...
1
3170
by: enrio | last post by:
I have made a number of changes to the code of an access 2000 application, and now the person responsible for the application wants to import one change at a time into his "master copy", after he has understood the change. Most of the code in this application is in the forms. I find that I can export the code, and I can import the code of the modules, but I cannot import the code of the forms. I have exported the code of the forms to...
1
3124
by: Unebrion | last post by:
Alright im working on a program that prints out user imput in a frame, along with a barcode.. it is like the front of an envelope. Here is the description for the program. This part just explains a check digit.. i think this part in my program is alright These barcodes actually have four parts: a tall line as the first bar, a series of tall and short lines corresponding to the digits in the ZIP code, a check digit,...
4
6212
by: AshishMishra16 | last post by:
HI friends, I am using the Flex to upload files to server. I m getting all the details about the file, but I m not able to upload it to Server. Here is the code i m using for both flex & for Struts: import java.io.File; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator;
0
3851
by: alivip | last post by:
Is python provide search in parent folder contain sub folders and files for example folder name is cars and sub file is Toyota,Honda and BMW and Toyota contain file name camry and file name corola, file name honda contain folder accord and BMW contain file name X5 Is there way to enter name of parent folder(cars) and search in all sub folder(Toyota,Honda and BMW) and files ? how can I intgreat cod to be user interface (buttun ,text box...
0
1911
by: alivip | last post by:
I write code to get most frequent words in the file I won't to implement bigram probability by modifying the code to do the following: How can I get every Token (word) and PreviousToken(Previous word) and frequency and probability From text file and put each one in cell in table For example if the text file content is "Every man has a price. Every woman has a price." First Token(word) is "Every" PreviousToken(Previous...
0
8256
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8694
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8356
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7184
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6118
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1500
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.