My environment: WIN XP SP2, VB6 SP5, MS ADO 2.5, Oracle 9.i, MS ODBC
for Oracle 2.575
I have a VB application in which I connect to a Oracle database via
ADO and ODBC. I used to use the ODBC driver from Oracle, but for some
reason I MUST use the ODBC driver from MS for Oracle now. Recently I
noticed, that the CommandTimeout property of the ADO-connection (as
well as ADO-command) object is not evaluated. With the ODBC driver
from Oracle I received a timeout error (as expected), when the SQL
statement took too long. However, the ODBC driver from MS for Oracle
doesn't care about the timeout property. My application is locked as
long as the statement needs to execute. Is there any way to get the MS
driver to evaluate the timeout property?
Here is my example code:
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Dim strConnect As String
Set cnn = New ADODB.Connection
Set cmd = New ADODB.Command
strConnect = "DSN=MyMSOraDSN;User ID=MyUser;Password=MyPwd;Initial
Catalog=MyScheme"
cnn.ConnectionString = strConnect
cnn.Open
cnn.CommandTimeout = 1
Set cmd.ActiveConnection = cnn
cmd.CommandTimeout = 1
cmd.CommandText = "Select * From vwLastTooLong"
cmd.Execute
cnn.Close
Thanks!
Markus
Val Mazur - 26 Feb 2005 02:12 GMT
Hi Markus,
Check this out
http://support.microsoft.com/default.aspx?scid=kb;en-us;251248

Signature
Val Mazur
Microsoft MVP
http://xport.mvps.org
> My environment: WIN XP SP2, VB6 SP5, MS ADO 2.5, Oracle 9.i, MS ODBC
> for Oracle 2.575
[quoted text clipped - 31 lines]
> Thanks!
> Markus