Article View: borland.public.cppbuilder.database.ado
Article #4198Re: What`s wrong this code?
From: Formentz
Date: Tue, 19 Mar 2002 08:40
Date: Tue, 19 Mar 2002 08:40
58 lines
2803 bytes
2803 bytes
When you use the \ character in a string you have to use it twice to get a \
character :
Source=C:\\WORK\\C_Project\\BCB5\\testADO\\Data\\cat22.mdb
HTH
Ciao
Formentz
"Slava Sh." <slava@space.com> ha scritto nel messaggio
news:3c96d743_1@dnews...
> Hello
>
> I generate connection string & test it in design-time. All test OK.
> Then I copy that string to ConnectionString from Clipboard:
>
> .... TForm::BtnClick(...)
> try
> {
>
>
> // DM - DataModule
>
> DM->ADOConnection->Close();
> DM->ADOConnection->ConnectionTimeout = 15;
> DM->ADOConnection->LoginPrompt = false;
> //
> WideString ConnectionString =
> "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
> Source=C:\WORK\C_Project\BCB5\testADO\Data\cat22.mdb;Mode=Share Deny
> None;Extended Properties="";Persist Security Info=False;Jet OLEDB:System
> database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet
> OLEDB:Engine Type=4;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global
> Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New
> Database Password="";Jet OLEDB:Create System Database=False;Jet
> OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on
> Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet
> OLEDB:SFP=False"; //
> //
> DM->ADOConnection->ConnectionString = ConnectionString;
> //
> DM->ADOConnection->Mode = cmShareDenyNone;
> DM->ADOConnection->Provider = "Microsoft.Jet.OLEDB.4.0";
> //
> DM->ADOConnection->Connected = true;
> }
> catch(EOleException &E)
> {
> Application->MessageBox(
> "Error connect MDB !",
> "Error",
> MB_OK + MB_ICONSTOP + MB_SYSTEMMODAL);
> }
>
> When I launch Application & click Btn - I see 'NOT A VALID FILENAME' !!!
> What`s wrong in this code???
>
> Thanks
> SLAVA
Technical Details
Message-ID:
<3c96f970$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!cyclone2.usenetserver.com!usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3c96d743_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,c2952da0fff9a65f X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-03-19 00:46:08 PST From: "Formentz" <francesco@leotron.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3c96d743_1@dnews> Subject: Re: What`s wrong this code? Date: Tue, 19 Mar 2002 09:40:50 +0100 Lines: 61 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 80.16.99.17 Message-ID: <3c96f970$1_1@dnews> X-Trace: dnews 1016527216 80.16.99.17 (19 Mar 2002 00:40:16 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!cyclone2.usenetserver.com!usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews