Re: problem connecting to ADO programmatically
- From: "William Meyer" <meyer.wil@xxxxxxxxx>
- Date: 27 Apr 2008 09:32:37 -0700
Chris.Cheney wrote:
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).
Sorry, I did not provide adequate info. There is a ConnectString in
place statically, which I set up with the wizard. It works fine. The
problem comes when I try to merely change the Data Source element of
that string.
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;
I will give it a try with those minimal elements. What I find
interesting now is that I took the string constants from the existing
ConnectString I set with the wizard. If I simply copy that to a local
var and copy the local var back to the ConnectString, all is well. If I
try to make any alteration to the content of the string before
assigning it to ConnectString, I get the error. And of course, that
error message is both misleading and unuseful, as it is a) not a
problem with ISAM, and b) it gives no clue what it's unhappy about .
--
Bill
.
- Follow-Ups:
- Re: problem connecting to ADO programmatically
- From: Chris.Cheney
- Re: problem connecting to ADO programmatically
- References:
- problem connecting to ADO programmatically
- From: William Meyer
- Re: problem connecting to ADO programmatically
- From: Chris.Cheney
- problem connecting to ADO programmatically
- Prev by Date: Re: Use GUID instead of AutoInc
- Next by Date: Re: problem connecting to ADO programmatically
- Previous by thread: Re: problem connecting to ADO programmatically
- Next by thread: Re: problem connecting to ADO programmatically
- Index(es):
Relevant Pages
|