Article View: borland.public.cppbuilder.database.ado
Article #4196What`s wrong this code?
From: Slava Sh.
Date: Tue, 19 Mar 2002 06:14
Date: Tue, 19 Mar 2002 06:14
48 lines
2486 bytes
2486 bytes
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:
<3c96d743_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!news-out.spamkiller.net!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,c2952da0fff9a65f,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-03-18 22:23:02 PST From: "Slava Sh." <slava@space.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: What`s wrong this code? Date: Tue, 19 Mar 2002 09:14:35 +0300 Lines: 50 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 195.161.129.83 Message-ID: <3c96d743_1@dnews> X-Trace: dnews 1016518467 195.161.129.83 (18 Mar 2002 22:14:27 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!news-out.spamkiller.net!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews