ConnectionTimeout is always 15 coming back from the DataLinksClass dialog

  • Thread starter Thread starter nuychaco
  • Start date Start date
N

nuychaco

I have an application where we use the OleDb DataLinkClass dialog to
retrieve the connection string. In the advanced tab one can set the
connection time. I set it to any value but the dialog always returns
the default 15.

I am connecting to SqlServer using the MS OleDB Component Service
Provider.

Is this a bug or limitation? Or does it indicate that the connection
time is not supported by provider. Although I noticed in the threads
that one can set connection time directly in the connection string
which indicates that it is supported.

Thanks
 
Hi,

I would suggest to set timeout in a connection string directly. In this case
you will avoid any issues. It is supported with OLEDB for SQL Server
 
Thanks Val for the suggestion.

The thing is my application calls for gathering of the connection
string parameters through the Data Link Properties dialog. This dialog
does not allow a user to enter the connection string directly. It has a
Connect Timeout field in the Advanced tab. Andany value the user enters
seems to be ignored and the dialog passes back the default Connection
Time to my application.

My question is how do I make this dialog behave correctly or is it not
possible, i.e., a Microsoft bug without any circumvention.

Thanks,
Nick
 
How to reproduce it? If it is a bug, then you would need to build connection
string dynamically. I would prefer this way anyway.
 
Hi Val,

Quite easy to reproduce ... see code snippet below

private void button1_Click(object sender, System.EventArgs e)
{
string retVal = string.Empty;


ADODB.Connection connection = null;
MSDASC.DataLinks links = new MSDASC.DataLinksClass();


System.Object connectionObject = links.PromptNew(); // dialog
pops, enter time = 77
connection = (ADODB.Connection)connectionObject;
retVal = connection.ConnectionString;
int timeOut = connection.ConnectionTimeout; // this value is always
15


}


The point is the Data Links dialog shows Connect Time in one of its tab
and the customer naturally expects that they can enter and modify it
and that our application will take the value from there.

Thanks,
Nick
 
Back
Top