473,378 Members | 1,504 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,378 software developers and data experts.

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 1728
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 "automatically" 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
TransferSpreadsheet 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
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...
4
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...
5
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...
1
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...
1
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...
1
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...
4
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...
0
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,...
0
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 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.