Re: Connectionstring error with MS Access DB
From: Bob Dalton (bob.dalton_at_removeme_digitallogistics.com)
Date: 07/14/04
- Next message: Jeremy Collins: "Re: Connectionstring error with MS Access DB"
- Previous message: Arthur Hoornweg: "Re: fastest way to insert one record into a table"
- In reply to: Jeremy Collins: "Re: Connectionstring error with MS Access DB"
- Next in thread: Jeremy Collins: "Re: Connectionstring error with MS Access DB"
- Reply: Jeremy Collins: "Re: Connectionstring error with MS Access DB"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
- Next message: Jeremy Collins: "Re: Connectionstring error with MS Access DB"
- Previous message: Arthur Hoornweg: "Re: fastest way to insert one record into a table"
- In reply to: Jeremy Collins: "Re: Connectionstring error with MS Access DB"
- Next in thread: Jeremy Collins: "Re: Connectionstring error with MS Access DB"
- Reply: Jeremy Collins: "Re: Connectionstring error with MS Access DB"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|