Article View: borland.public.cppbuilder.database.ado
Article #4199Re: What`s wrong this code?
From: Vassiliev V.V.
Date: Tue, 19 Mar 2002 08:31
Date: Tue, 19 Mar 2002 08:31
68 lines
3083 bytes
3083 bytes
1. Try reduce ConnectionString to
Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\WORK\C_Project\BCB5\testADO\Data\cat22.mdb
2. Comment line DM->ADOConnection->Connected = true; - you set already
provider in ConnectionString.
3. Check that your file C:\WORK\C_Project\BCB5\testADO\Data\cat22.mdb
exists.
Regards,
Vassiliev V.V.
http://www.oledbdirect.com
"Slava Sh." <slava@space.com> �������/�������� � �������� ���������:
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:
<3c96f92a_2@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 X-Google-Thread: 10698b,c2952da0fff9a65f X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-03-19 00:46:09 PST From: "Vassiliev V.V." <vv_vas@iname.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3c96d743_1@dnews> Subject: Re: What`s wrong this code? Date: Tue, 19 Mar 2002 11:31:07 +0300 Lines: 70 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: 62.118.135.16 Message-ID: <3c96f92a_2@dnews> X-Trace: dnews 1016527146 62.118.135.16 (19 Mar 2002 00:39:06 -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