Re: problem connecting to ADO programmatically
- From: "Chris.Cheney" <Chris.CheneyXXNOSPAMXX@xxxxxxxxx>
- Date: 27 Apr 2008 01:32:51 -0700
"William Meyer" <meyer.wil@xxxxxxxxx> wrote in news:4813632c$1
@newsgroups.borland.com:
I have taken the connection string created using the MS wizard, and
broken it into a series of constants, so I can replace the file path
dynamically. When I attempt to do this, I get the "Could not find
installable ISAM" error message. My code:
<snipped the complicated stuff>
If I comment out the assignment to ADOConnCAPWatch.ConnectionString,
there is no error. I have tried commenting out parts of the tail
strings, finally reaching this:
ConnStr := ADOProvider + ADOPassword + ADOUserID;
target := 'DataSource=' + DBFile + ';';
ConnStr := ConnStr + target; // + ADOMode + ADOExtProp + ADOJetTail;
ADOConnCAPWatch.ConnectionString := WideString(ConnStr);
ADOConnCAPWatch.Open;
Result := ADOConnCAPWatch.Connected;
I still get the error. Any suggestions?
Hi Bill,
Perhaps your ADOConnCAPWatch component has acquired some custom settings?
With the default component and no connection string, an error SHOULD
occur when it is opened - but you say that there is no error in this
case. Try creating the component dynamically (to be sure it has no custom
settings).
FWIW The following works for me (AdoConnection1 is a default instance of
the TAdoConnection component - i.e. no custom settings):
const
Provider = 'Provider=Microsoft.Jet.OLEDB.4.0;';
DataSource = 'Data Source=C:\Documents and Settings\chris\My Documents
\Database Stuff\ExcelAdo Samples\data.mdb;';
User = 'User ID=admin;';
Password = 'Password="";';
begin
AdoConnection1.ConnectionString := Provider + DataSource + User +
Password;
AdoConnection1.Open;
end;
HTH
Regards
Chris
.
- Follow-Ups:
- Re: problem connecting to ADO programmatically
- From: William Meyer
- Re: problem connecting to ADO programmatically
- References:
- problem connecting to ADO programmatically
- From: William Meyer
- problem connecting to ADO programmatically
- Prev by Date: problem connecting to ADO programmatically
- Next by Date: Re: Use GUID instead of AutoInc
- Previous by thread: problem connecting to ADO programmatically
- Next by thread: Re: problem connecting to ADO programmatically
- Index(es):
Relevant Pages
|