 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
yag Guest
|
Posted: Mon Feb 21, 2005 9:38 am Post subject: how to using dao |
|
|
help me.!I did not know where to post
How to compact database mdm (access) witch ado or dao from code ...
~-----------------------------------------------------~
....c++, oo, designs are my passion...
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Mon Feb 21, 2005 2:51 pm Post subject: Re: how to using dao |
|
|
When compacting Access db it must be disconnected. Compact always into
another file. Later you may delete initial file and copy new file into its
place.
Import "Microsoft Jet and Replication Objects 2.x Library".
#include <JRO_TLB.h>
....
void __fastcall TForm1::Button1Click(TObject *Sender)
{
IJetEngine * JetEngine = NULL;
CoCreateInstance(CLSID_JetEngine, NULL, CLSCTX_INPROC_SERVER,
IID_IJetEngine, (void**) &JetEngine);
try
{
WideString Source = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\Test\Test.mdb;";
WideString Dest = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\Test\Compacted.mdb;";
JetEngine->CompactDatabase(Source.c_bstr(), Dest.c_bstr());
}
__finally
{
JetEngine->Release();
}
}
Compact will also repair database.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"yag" <yagyog (AT) tiscali (DOT) it> сообщил/сообщила в новостях следующее:
news:4219ac0f (AT) newsgroups (DOT) borland.com...
| Quote: | help me.!I did not know where to post
How to compact database mdm (access) witch ado or dao from code ...
~-----------------------------------------------------~
...c++, oo, designs are my passion...
|
|
|
| Back to top |
|
 |
yag Guest
|
Posted: Mon Feb 21, 2005 3:18 pm Post subject: Re: how to using dao |
|
|
"Viatcheslav V. Vassiliev" <support (AT) oledbdirect (DOT) com> ha scritto nel
messaggio news:4219f580 (AT) newsgroups (DOT) borland.com...
| Quote: | When compacting Access db it must be disconnected. Compact always into
another file. Later you may delete initial file and copy new file into its
place.
Import "Microsoft Jet and Replication Objects 2.x Library".
#include <JRO_TLB.h
...
void __fastcall TForm1::Button1Click(TObject *Sender)
{
IJetEngine * JetEngine = NULL;
CoCreateInstance(CLSID_JetEngine, NULL, CLSCTX_INPROC_SERVER,
IID_IJetEngine, (void**) &JetEngine);
try
{
WideString Source = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\Test\Test.mdb;";
WideString Dest = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\Test\Compacted.mdb;";
JetEngine->CompactDatabase(Source.c_bstr(), Dest.c_bstr());
}
__finally
{
JetEngine->Release();
}
}
tnks... but which it is the DLL to import? |
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Tue Feb 22, 2005 1:04 pm Post subject: Re: how to using dao |
|
|
In IDE select "ProjectImport type library" and choose "Microsoft Jet and
Replication Objects 2.x Library".
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"yag" <yagyog (AT) tiscali (DOT) it> сообщил/сообщила в новостях следующее:
news:4219f986$1 (AT) newsgroups (DOT) borland.com...
| Quote: | "Viatcheslav V. Vassiliev" <support (AT) oledbdirect (DOT) com> ha scritto nel
messaggio news:4219f580 (AT) newsgroups (DOT) borland.com...
When compacting Access db it must be disconnected. Compact always into
another file. Later you may delete initial file and copy new file into
its
place.
Import "Microsoft Jet and Replication Objects 2.x Library".
#include <JRO_TLB.h
...
void __fastcall TForm1::Button1Click(TObject *Sender)
{
IJetEngine * JetEngine = NULL;
CoCreateInstance(CLSID_JetEngine, NULL, CLSCTX_INPROC_SERVER,
IID_IJetEngine, (void**) &JetEngine);
try
{
WideString Source = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\Test\Test.mdb;";
WideString Dest = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\Test\Compacted.mdb;";
JetEngine->CompactDatabase(Source.c_bstr(), Dest.c_bstr());
}
__finally
{
JetEngine->Release();
}
}
tnks... but which it is the DLL to import?
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|