Article View: borland.public.cppbuilder.database.ado
Article #2042Access Violation closing application with ADO in DMod
From: Charles Kahler
Date: Wed, 19 Nov 2003 00:37
Date: Wed, 19 Nov 2003 00:37
36 lines
2427 bytes
2427 bytes
We have an application with an ADOConnection in a DataModule. Everything
runs fine, but when we close the application after the ADOConnection has
been established, we get an access violation. If the ADOConnection is
never established, we get no error on closing. We have no problem with
ADOConnections in other modules of the application. I have tried newing
the ADOConnection component in code as well as putting it directly on
the DMod. The code looks like this:
TADOConnection *ADOConnection1 = new TADOConnection(this);
ADOConnection1->CommandTimeout = 30;
ADOConnection1->ConnectionTimeout = 15;
ADOConnection1->ConnectOptions = coConnectUnspecified;
ADOConnection1->CursorLocation = clUseClient;
ADOConnection1->IsolationLevel = ilCursorStability;
ADOConnection1->KeepConnection = true;
ADOConnection1->LoginPrompt = false;
ADOConnection1->Provider = "Microsoft.Jet.OLEDB.4.0";
ADOConnection1->ConnectionString.Empty();
AnsiString conStr;
conStr.sprintf("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = %s;
Persist Security Info=False",
d:\\data\\datab.mdb );
ADOConnection1->ConnectionString = WideString( conStr );
ADOConnection1->Connected = true;
Connected is later set to false and the ADOCOnnection1 object is
deleted.
We are using C++Builder 6.0 with sp4. We are running on Windows2000 with
sp4 installed. In this application, we are running against an Access
2000 database, but I believe we have seen the same thing with other
databases.
What are we doing wrong?
- charley
Technical Details
Message-ID:
<3FBABB46.1B4B8F2B@lmco.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,4d9e8f0b652995b0,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-11-18 16:39:28 PST Message-ID: <3FBABB46.1B4B8F2B@lmco.com> Date: Tue, 18 Nov 2003 17:37:26 -0700 From: Charles Kahler <charles.kahler@lmco.com> X-Mailer: Mozilla 4.61 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.ado Subject: Access Violation closing application with ADO in DMod Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 192.31.106.194 X-Trace: newsgroups.borland.com 1069202245 192.31.106.194 (18 Nov 2003 16:37:25 -0700) Lines: 37 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail