Article View: borland.public.cppbuilder.database.ado
Article #1505Re: Create new database problem
From: Martin Moeller
Date: Fri, 23 Apr 2004 18:11
Date: Fri, 23 Apr 2004 18:11
52 lines
2943 bytes
2943 bytes
Vassiliev, thank you very much.
I've tested your code & it works fine.
void __fastcall TfrmMain::btnCreateClick(TObject *Sender)
{
WideString strConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=" + ExtractFilePath(ParamStr(0)) + "test.mdb";
Adox_tlb::TCOM_Catalog cat = CoCatalog::Create();
cat->Create(strConn.c_bstr());
cat.Release();
}
Then I also debugged mine and found a few intersting anomalities about that
exception:
---------------------------
HRCHECK:
---------------------------
(this->Create(ConnectString, (VARIANT*)&Connection)) Error: 80040E17
(-2147217897) @ c:\programmi\borland\cbuilder6\Imports\ADOX_TLB.h/487
Press [Y]es to terminate, [N]o to continue and [C]ancel to Debug
---------------------------
SīŋŊ No Annulla
---------------------------
On my string he could not manage the root-without-drive definition. It's a
long time ago, but I think it was a legal DOS statement.
Data Source=.\\New.mdb"; fails
Data Source=C:\\New.mdb"; works
Further this exception seems to be a catch-all type. It is produced also if
the file already exists, i.e. in our case pressing the button twice.
I've been working to create Tables and primary keys, as well as foreign
keys, in which case the table declaration sequence must be consistent of
course.
Trying to create a foreign key via ASSERTION makes an error. Can you do it
at all in MS ACCESS? Or is there another way to specify foreign keys outside
the table?
ExecuteString= "CREATE ASSERTION peppo \
FOREIGN KEY [ActiveNow](ETA) REFERENCES
[Tab2](ETA_PRKEY))";
Where do u find a list of implemented comands?
Tks again, Martin
Technical Details
Message-ID:
<40895c5a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!nx02.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4087d2f4@newsgroups.borland.com> <4087ef31$1@newsgroups.borland.com> <4087ff9c$1@newsgroups.borland.com> <40881473$1@newsgroups.borland.com> <40881b61$1@newsgroups.borland.com> <4089186f@newsgroups.borland.com> <408924bc@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,270202afc138267d X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2004-04-23 11:19:39 PST Reply-To: "Martin Moeller" <martin.moeller@moema.it> From: "Martin Moeller" <martin.moeller@moema.it> Newsgroups: borland.public.cppbuilder.database.ado References: <4087d2f4@newsgroups.borland.com> <4087ef31$1@newsgroups.borland.com> <4087ff9c$1@newsgroups.borland.com> <40881473$1@newsgroups.borland.com> <40881b61$1@newsgroups.borland.com> <4089186f@newsgroups.borland.com> <408924bc@newsgroups.borland.com> Subject: Re: Create new database problem Date: Fri, 23 Apr 2004 20:11:35 +0200 Lines: 55 Organization: Moe.Ma Italiana Srl X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 212.171.6.186 Message-ID: <40895c5a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1082743898 212.171.6.186 (23 Apr 2004 11:11:38 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!nx02.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail