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

Importing several files with path according to field

7
Hello, I would really appreciate some help, Im quite a newbie with VB in access.

What Im trying to do is to import several XLS files that are distributed in various folders in C:\

I`ve made a table in wich one of the fields contains the PATH to each of those files, so what I need should be simple a simple task to do: a routine that iterate the full recordset reading all those paths and automatically import the files contained in those folders into a new table.

Any ideas will be most welcomed!
Dec 3 '08 #1
1 1129
ChipR
1,287 Expert 1GB
I'm sorry I haven't learned about importing yet, but I can give you the code to iterate through the recordset if you don't have it already. Maybe someone can fill in the import stuff.

Expand|Select|Wrap|Line Numbers
  1. Dim db as Database
  2. Dim records as DAO.RecordSet
  3.  
  4.     Set db = CurrentDb()
  5.     Set records = db.OpenRecordset("myTable")
  6.  
  7.     while not records.eof
  8.         'import based on records!fieldName
  9.         records.MoveNext
  10.     wend
  11.  
  12.     records.close
  13.     set records = Nothing
  14.     db.close
  15.     set db = Nothing
Dec 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Glen | last post by:
I presently use the following code to import an Excel Spreadsheet: DoCmd.TransferSpreadsheet acImport, SpreadsheetType:=8, _ TableName:="tblImportPlayerInformation", _...
11
by: Grim Reaper | last post by:
I am importing a .csv file into Access that has 37 fields. My problem is that sometimes the last field only has data at the end of the column (it looks like when you import a file into Access, for...
1
by: sparks | last post by:
I have never done this and wanted to ask people who have what is the best way. One person said import it to excel, then import it into access table. but since this will be done a lot, I am...
3
by: Brenda | last post by:
How can I change the name of a table as I import it? I have a form in Access that needs to accept files from different sources (mainly dBase III). I need one field out of these tables, called...
5
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way...
28
by: kkadakia | last post by:
I get a daily excel file for a entire month which I want to transfer into Access at the end of the month. So, there are around 20-25 excel files I get by the end of the month, and I would like to...
2
by: Debbiedo | last post by:
I have a text file that I am importing into an Access table that was generatred from data exported from a Word file. Several (about 20-30) fields are from check boxes on the Word form. These fields...
5
by: MLH | last post by:
I'm using A97 import data wizard to import text file N2 a table. The text file is a DIR listing produced by running dir jdc*.* /s c:\JDCs.txt The wizard is chopping the lines off at the...
4
by: chimambo | last post by:
I have 2 problems: 1. I want to import a single text file into an access table using a Macro. I am however getting an error that I need to put a specification name argument. What does this mean?...
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
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
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
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.