🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3168

Re: How do i create a .mdb file

#3168
From: Joachim Atzenhofer
Date: Wed, 27 Nov 2002 10:32
77 lines
3513 bytes
"Vassiliev V.V." <news@vassilievvv.mtu-net.ru> schrieb im Newsbeitrag
news:3de469d7@newsgroups.borland.com...
>
> >Can i suppress this Message?
> Please provide your code.
>

Unit1.h:

//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ADOX_tlb.h>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // Von der IDE verwaltete Komponenten
   TButton *Button1;
   void __fastcall Button1Click(TObject *Sender);
private: // Anwender-Deklarationen
public:  // Anwender-Deklarationen
   __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif


Unit1.cpp:

//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
   : TForm(Owner)
{}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
   String strPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\\test.mdb";

   try
   {
      Adox_tlb::TCOM_Catalog cat = CoCatalog::Create();
      cat->Create(WideString(strPath).c_bstr());
   }
   catch(...)
   {
      ShowMessage("Error!");
   }
}
//---------------------------------------------------------------------------

The first time i klick on the button1, it works.
The second time (because a database is there) an error occurs
and i get the message:

(this->Create(ConnectString, (TVariant*)&Connection)) Error: 80040E17 (-2147217897) @
C:\Programme\Borland\Cbuilder5\imports\ADOX_tlb.h/465
Press [Y]es to terminate, [N]o to continue and [C]ancel to Debug.

I don't want this Message, I only want my own Message.

Joachim
Technical Details
Message-ID: <3de49f43@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3dd42aa7@newsgroups.borland.com> <3dd4b4d0@newsgroups.borland.com> <3dde4255$1@newsgroups.borland.com> <3dde62c1@newsgroups.borland.com> <3de3678d$1@newsgroups.borland.com> <3de469d7@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,f9436a8943db1d6f
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-11-27 02:37:59 PST
From: "Joachim Atzenhofer" <newsatze@gmx.de>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3dd42aa7@newsgroups.borland.com> <3dd4b4d0@newsgroups.borland.com> <3dde4255$1@newsgroups.borland.com> <3dde62c1@newsgroups.borland.com> <3de3678d$1@newsgroups.borland.com> <3de469d7@newsgroups.borland.com>
Subject: Re: How do i create a .mdb file
Date: Wed, 27 Nov 2002 11:32:35 +0100
Lines: 79
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 217.5.216.12
Message-ID: <3de49f43@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1038393155 217.5.216.12 (27 Nov 2002 02:32:35 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail