Re: Cannot Connect ADOConnection at Run-Time
- From: "Betsy" <betsy.a.tainer@xxxxxxxxxxxxx>
- Date: Tue, 26 Apr 2005 09:19:14 -0700
Hey Mike....
Your code is not building the same connection string as your connection
string... if you know what I mean.
You're gonna have to construct it exactly if you're gonna go that way....
semi-colons and all. You are changing words, ie, the provider is completely
different, what is 'data source', and where is DSN...
I think you'll find too that wherever you see a 'quote' in the string that
you'll have to provide that if you are building the sting on the fly... (why
are you doing all of this??? I just drop it, fill it in and go... connect
in the application and don't fiddle with the connection string... how is
yours different?)
So, like this: connstring + '''some stupid line of text that needs to be
quoted in the string''';
hope that helps
b
"Mike Sandoval" <NoThankYou@xxxxxxxxxxxxxx> wrote in message
news:426e3bcc@xxxxxxxxxxxxxxxxxxxxxxxxx
> Andy wrote:
> > What is your ConnectionString ?
> >
> > Andy
> > "Mike Sandoval" <NoThankYou@xxxxxxxxxxxxxx> wrote in message
> > news:426dab20$1@xxxxxxxxxxxxxxxxxxxxxxxxx
> >
> >>Thank you Betsy,
> >>
> >>It still does not work. It only works if it is set Connected := true at
> >>design time; otherwise, I cannot connect at Run-time.
> >>
> >>Any other ideas?
> >>
> >>Mike
> >
> >
> >
> Andy,
>
> Here is my ConnectionString:
>
> Provider=MSDASQL.1;Persist Security Info=False;User
> ID=administrator;Extended Properties="DSN=MS Access
> Database;DBQ=C:\Data\ABC Database\db1.mdb;DefaultDir=C:\Data\ABC
> Database;DriverId=25;FIL=MS
> Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;"
>
>
>
> I have also tried...
>
> strfile := 'C:\Data\ABC Database\db1.mdb';
> with ADOConnection1 do begin
> Close;
> ConnectionObject := nil;
> end;
> ADOConnectionString := '';
> ADOConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;';
> ADOConnectionString := ADOConnectionString + 'Data Source=' + strfile
> + ';';
> ADOConnectionString := ADOConnectionString + 'Persist Security
> Info=True' +';';
> ADOConnection1.ConnectionString := ADOConnectionString;
>
> Thanks...
.
- Follow-Ups:
- Re: Cannot Connect ADOConnection at Run-Time
- From: Mike Sandoval
- Re: Cannot Connect ADOConnection at Run-Time
- References:
- Cannot Connect ADOConnection at Run-Time
- From: Mike Sandoval
- Re: Cannot Connect ADOConnection at Run-Time
- From: Betsy
- Re: Cannot Connect ADOConnection at Run-Time
- From: Mike Sandoval
- Re: Cannot Connect ADOConnection at Run-Time
- From: Andy
- Re: Cannot Connect ADOConnection at Run-Time
- From: Mike Sandoval
- Cannot Connect ADOConnection at Run-Time
- Prev by Date: Editing a view
- Next by Date: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- Previous by thread: Re: Cannot Connect ADOConnection at Run-Time
- Next by thread: Re: Cannot Connect ADOConnection at Run-Time
- Index(es):
Relevant Pages
|