Re: Connectionstring error with MS Access DB

From: Bob Dalton (bob.dalton_at_removeme_digitallogistics.com)
Date: 07/14/04


Date: Wed, 14 Jul 2004 09:40:12 -0500

After I wrote this message I did some further testing and found that while
an exception is being generated the connection still completes.
Unfortunately if you are using a standard try > except routine to make the
connection then connection will not complete as an exception is generated
before the connection can complete. For testing purposes I re-wrote the
routine to read the exception in the "except" section as follows:

  except
    ADOErrorMsgIs1 :=
ADOConnection1.Errors.Item[ADOConnection1.Errors.Count - 1].Description;
    if ADOErrorMsgIs1 <> 'Read-only property value was not set.' then
    begin
      WeAreConnectedToADO := False;
      if MessageDlg('Cannot connect to ADO database. Configure ' +
        'ADO Connection?', mtError, [mbYes, mbNo], 0) = mrYes then
      begin
        ConfigADODatabase;
        ConnectADODatabase;
      end
      else
        Result := False;
    end
    else
    begin
      if ADOErrorMsgIs1 = 'Read-only property value was not set.' then
      begin
        WeAreConnectedToADO := True;
        Result := True;
      end
      else
      begin
        Result := False;
      end;
    end;
  end;

Not pretty or elegant but it works good enough for testing purposes which is
all that I wanted at this point. I tried different things, such as what you
suggest in eliminating the mode, but the results were always the same with
the same error being generated. Perhaps a problem with MDAC version 2.8 when
using Microsoft.Jet.OLEDB.4.0?

Funny thing is I do not get this exception with other then the
Microsoft.Jet.OLEDB.4.0.

Most of the references I have on the subject indicate using the method I am
using. As for using a DTS package what are the advantages over the method I
am using currently for connecting my client to the MDB file and where on the
Internet can I go to read up on that?

Regards;

Bob Dalton

"Jeremy Collins" <jd.collins@ntlworld-not.com> wrote in message
news:40f4e884$1@newsgroups.borland.com...
<snip>
> Probably the Mode=ReadWrite setting - you don't need it for Access
> (or SQL Server IME). Remove it from the connection string and try
> again.
>
> But why don't you just use a DTS package?



Relevant Pages

  • get your potentially resuming element on board my squad
    ... exclusive era. ... require a transmission! ... it eases a contest too positive in connection with her ...
    (sci.crypt)
  • RE: Web.config update to allow remote connection to sql server 200
    ... The line throw an exception is this line: ... I looked at code and it seems hard that to find out what database connection ... Microsoft Online Community Support ...
    (microsoft.public.vsnet.general)
  • Re: SF: Refresher course
    ... All instant diplomatic house substitutes computers ... Hey, I'll decline the german. ... in connection with me it's ... access after Virginia blocks the strict kingdom's exception? ...
    (sci.crypt)
  • Re: Strange sudden shutdown issue with CF app
    ... Phone devices are notoriously low on virtual memory right out of the box because the OEMs decide to put every little thing into its own DLL and then have 25 processes launched at boot. ... Chris Tacke, Embedded MVP ... We have created an app that basically connects to a web service gets data, then stores it locally on the device, and when a record needs to be modified/added the system first tries to connect the web server sees if its availible, if not then it stores in locally on the device until the connection comes back, now I noticed that if the device does not mess around with the data connection then the application sits nicely as long as its open, and never gets shut down. ... But again most of the time I get no exception at all but just simply disappears. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Remobjects, good in multi-threading environment?
    ... for your client-side connection component and have the RTC SDK handle all processing in background threads, while you can still make your calls from the main thread, from a timer or from other threads. ... And any exception causes a very thorough ... Each method cleans up itself thoroughly and re-raises exceptions until ...
    (borland.public.delphi.thirdpartytools.general)