BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to using dao

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO)
View previous topic :: View next topic  
Author Message
yag
Guest





PostPosted: Mon Feb 21, 2005 9:38 am    Post subject: how to using dao Reply with 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
Viatcheslav V. Vassiliev
Guest





PostPosted: Mon Feb 21, 2005 2:51 pm    Post subject: Re: how to using dao Reply with 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();
}
}

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





PostPosted: Mon Feb 21, 2005 3:18 pm    Post subject: Re: how to using dao Reply with quote



"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





PostPosted: Tue Feb 22, 2005 1:04 pm    Post subject: Re: how to using dao Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.