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.

Import/Export access tables to xls file

21
hey guys,
I have a access (2000 format) database. I want to be able to export all the tables in it onto a single .xls file and import it from an identical .xls file (for example if i email the tables ONLY to another person who has the same Db structure, he should be able to cleanly import the tables and see the data on his DB). I can currently do 2 things.
1- export all tables into one .xls file using
Expand|Select|Wrap|Line Numbers
  1. strFullPath = "D:\Database\ALL_DATA.xls"
  2. DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "tbl_1", strFullPath, False
  3. DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "tbl_2", strFullPath, False
  4. DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "tbl_3", strFullPath, False
  5.  
I found this code online, but I cant come up with a code that lets me import the tables in such a manner.

2- I can use a macro to export/import. I can do this export/import on individual tables (into individual expective .xls files) perfectly, but once i try to import more than one table from the .xls file it gives a problem. It messes up the tables' format. Meaning it expects tbl_2 to have the same tructure as tbl_1.

What can be wrong here? And how can i fix it... I would prefer to use a fixed version solution 1 as it feels more contrete to me (personal opinion).
Thanks guys!
Jul 20 '10 #1
2 2212
dileshw
21
I dont know if i'm asking too much fo you guys (and MS office), but is it possible to maybe send ONLY the newer portion of the database into the .xls sheet?
I mean say its a continuously growing database.. I want to send ONLY the records that i inserted/modified today, rather than send everything.
I dont have a timestamp or anything to give a sense of time on the editing, but the only way i can think of is for access/excel to manually compare and remove the ones that havent changed.... Is this possible?
Jul 20 '10 #2
NeoPa
32,556 Expert Mod 16PB
If you use the same value in strFullPath, does it not write the data into separate worksheets in the same spreadsheet?

As for exporting only the deltas (differences between one day and the next) this will only be possible if you design the possibility into your data structure. Databases don't work on magic. There must be a logical way to discern the data before it can be separated. I would suggest adding a date of update field. With deltas you also need to make sure you consider all of :
Additions
Amendments
Deletions

Have you considered this aspect?
Jul 20 '10 #3

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

Similar topics

5
by: steve | last post by:
Hi, When I copy tables in a database from one server to another using enterprise manager, everything copies ok, except for field defaults. Has anyone seen this, and what is the solution? --...
3
by: Gaffar | last post by:
Hello, how to export ms-access tables information to excel sheet using ASP. please give sample code. it is very urgent to me or if u have no idea please give any news group to solve my...
0
by: Nolan | last post by:
I have an XML document from another database that I can successfully import into Access. There are multiple tables and they all parse correctly into those tables in Access. I can manipulate the...
3
by: Iavor Raytchev | last post by:
Hello, We a situation with a central database that contains the data that needs to be presented at N off-line terminals (N can be 5 000 can be 15 000). Each terminal presents unique data. The...
1
by: Stella | last post by:
Help!!! Am extremely new to VBA. Want to set up code behind a button that will prompt the user for a table name(source of data) and file name(end result of export) and then export the data into a...
0
by: sarsa | last post by:
Do someone know a simple way to import/export an Excel file in VC# .NET? I tried to use Office XP PIAs but I have some problems (which do not lokk so clear to me). The software I am working on is...
0
by: =?Utf-8?B?VHVsc2k=?= | last post by:
Hi, How can I export/import data from SQL server tables to/from an XML file? Note: I want to tdo this from a desktop application written in c# and uses sql server tables for storing data. ...
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
5
by: bhodgins | last post by:
Hi, I am new on here, and had a newbie question that I am stumped with. I am not new to access, but am new to VB. I am trying to export BLOBs from a field called photo to external jpeg files. I...
4
by: Max2006 | last post by:
Hi, We are developing a SQL server based asp.net application. As part of requirement we should allow users import/export some relational data through web user interface. We are investigation...
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: 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
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
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.