random error (method execute of object _Connection failed) 
Author Message
 random error (method execute of object _Connection failed)

We have a program that does the following:
it opens at least 2 connections to two different databases.
Several recordsets are fetched from the database using an Execute statement.
These recordsets are then disconnected.
Other recordsets are openen with the recordset open method.
Somethimes (while debugging) we get the error message mentionned (method
execute of object _Connection failed)

The program always crashes with this message.
The instruction at " " referenced memory at " "

Strange:
  1. we crash at different locations (executing the code in exactly the same
conditions over and over again)
  2. we're only able to reproduce this failure on particular machines. (I
think all of them run Windows 2000).
      Different machines (running Windows XP) do not crash.

Any clues ?
Thanks in advance,
Micha?l



Sat, 21 May 2005 22:32:14 GMT  
 random error (method execute of object _Connection failed)
Yup. Check your MDAC version on both systems. I'll bet they're different.
Use Component Checker (see www.microsoft.com/data)

hth

--
________________________________
William (Bill) Vaughn, Author, Trainer, Mentor
Microsoft Pacwest Regional Director, MVP
"ADO.NET and ADO Examples and Best Practices for VB Programmers--2nd
Edition" (ISBN: 1-893115-68-2)
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
________________________________

Quote:
> We have a program that does the following:
> it opens at least 2 connections to two different databases.
> Several recordsets are fetched from the database using an Execute
statement.
> These recordsets are then disconnected.
> Other recordsets are openen with the recordset open method.
> Somethimes (while debugging) we get the error message mentionned (method
> execute of object _Connection failed)

> The program always crashes with this message.
> The instruction at " " referenced memory at " "

> Strange:
>   1. we crash at different locations (executing the code in exactly the
same
> conditions over and over again)
>   2. we're only able to reproduce this failure on particular machines. (I
> think all of them run Windows 2000).
>       Different machines (running Windows XP) do not crash.

> Any clues ?
> Thanks in advance,
> Micha?l



Sun, 22 May 2005 03:35:05 GMT  
 random error (method execute of object _Connection failed)
Thanks for the sugestion,

We had been looking at the mdac versions.
First there was some version of ADO 2.6. Afterwards we installed ADO 2.7.
Component Checker didn't report any errors.

Then we found the following article
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q326834
We were able to reproduce the behaviour on the (one of) the computers where
we have this problem.
That is: open a recordset with adLockOptimistic, Close the recordset and
open a recordset with adLockReadOnly.
We got the same "The instruction at " " referenced memory at " "" message as
with the program that is problematic.
Next, we did a rollback of the installed mdac (2.7) and installed MDAC SP2
Refresh.
The problem with adLockOptimistic and adLockReadOnly was gone.

Disapointment: the problem in our program persists.

Some extra information:

Connections and recordsets are late bound.

There is some 'panic'-code (I find it odd, but it should work):
before every new recordset is used it is freed (is it?):

Public Sub FreeThisObject(pObject as Object)
  On Error Resume Next
  pObject.Close
  Set pObject = Nothing
  On Error Goto 0
End Sub

Private Sub Foo()
  FreeThisObject rs
  Set rs = CreateObject("ADODB.Recordset")
  with rs
    .ActiveConnection = cn
    ...
End Sub



Quote:
> Yup. Check your MDAC version on both systems. I'll bet they're different.
> Use Component Checker (see www.microsoft.com/data)

> hth

> --
> ________________________________
> William (Bill) Vaughn, Author, Trainer, Mentor
> Microsoft Pacwest Regional Director, MVP
> "ADO.NET and ADO Examples and Best Practices for VB Programmers--2nd
> Edition" (ISBN: 1-893115-68-2)
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> ________________________________



Sun, 22 May 2005 23:15:30 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Error -214722099 Method Connection of Object-current Project Failed

2. Execute method of Find object causes error 5692

3. Run Time error -2147417848 Method Of Object Failed

4. Method Action of object CrystalCtrl failed Error ?

5. ERROR : METHOD OF OBJECT FAILED

6. errors different when executing SQL statements via recordset or connection object

7. Working append qry fails when invoked with Execute method

8. Connection Fail after installation - dbnmpntw write() connection fail

9. Connection Fail after installation - dbnmpntw write() connection fail

10. COM+ Automation Error/connection to the transaction manager failed Error/ Q331953

11. using connection.execute method to insert row

12. Recordset and connection execute method with SSCE

 

 
Powered by phpBB® Forum Software