Solved

Close Access file to compress

Posted on 2003-10-26
1
152 Views
Last Modified: 2010-05-18
Hello Experts.

 In my program use Adotable to connect to msaccess file .
 I have a Function to compress file msAsscecc.

my question:

 How to close file msaacess before compress, I'd tried :

 Procedure TForm1.Button1Click(Sender: TObject);
 begin

 Adotable1.close;
 CompressData(filename);
......

but I get error .I know I can compress if data file not open.

 Please teach me how close access file to compress then reload it.

 Thanks.
 
 
0
Comment
Question by:z27
1 Comment
 
LVL 17

Accepted Solution

by:
geobul earned 60 total points
Comment Utility
Hi,

Add TADOConnection on the form. Write ADOConnection1.ConnectionString as it was in TADOTable1. Clear ADOTable1.ConnectionString and set its Connection property to ADOConnection1. Then write:

  ADOConnection1.Close;
  CompressData(filename);

Regards, Geo
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now