Re: Cannot Connect ADOConnection at Run-Time



Try setting the 'Persist Security Info=False'

You have it set to false in your original settings in design time - but then
setting it to true in your run time code.

Andy

"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...


.