-2147467259 Unspecified error using ADO 2.5 connection object 
Author Message
 -2147467259 Unspecified error using ADO 2.5 connection object

I have a VB application that runs continually on a Windows NT Server
and picks up messages from another server via TCP/IP (using Winsock).
Every time it recieves a message it creates a connection to a SQL 7.0
server database, and executes a stored procedure to update a table.
After this it closes the connection, and awaits the next message.

I have found that after about 2000 connections, the open statement
generates an error with the description 'Unspecified Error' (Number
-2147467259). To give an idea, here is some sample code I used in
investigating the error:

Dim conn As ADODB.Connection, cmd As ADODB.Command
i = 0
Do
   i = i + 1
   Set conn = New ADODB.Connection
   conn.Open "Provider=SQLOLEDB; Data Source=gbzoswfi" & _
             "; Initial Catalog=Test; User ID=Test; Password=xxxxxxxx"

   Set cmd = New ADODB.Command
   Set cmd.ActiveConnection = conn
   cmd.CommandText = "exec uspTestProc"
   cmd.CommandType = adCmdText
   cmd.Execute

   Set cmd.ActiveConnection = Nothing
   Set cmd = Nothing
   conn.Close
   Set conn = Nothing

Loop Until i > 10000

It is the conn.open statement that generates the error, after about
the 2000th iteration. Does anyone know what is causing this?



Wed, 28 Apr 2004 01:22:21 GMT  
 -2147467259 Unspecified error using ADO 2.5 connection object
Hi,

Probably it is a bug. It looks like there is some opened
connection or some garbage in memory after you close your
connection. What about if to open connection only once
during loading of your application and closing it during
unload. In that case you will open connection only once.
Also (it is not related to your probnlem) you can execute
SP using adCmdStoredProc parameter of command

cmd.CommandText = "uspTestProc"
cmd.CommandType = adCmdStoredProc + adExecuteNoRecords

In that case you will gain in performance, because of
optimization in ADO.

Val

Quote:
>-----Original Message-----
>I have a VB application that runs continually on a
Windows NT Server
>and picks up messages from another server via TCP/IP
(using Winsock).
>Every time it recieves a message it creates a connection
to a SQL 7.0
>server database, and executes a stored procedure to
update a table.
>After this it closes the connection, and awaits the next
message.

>I have found that after about 2000 connections, the open
statement
>generates an error with the description 'Unspecified
Error' (Number
>-2147467259). To give an idea, here is some sample code I
used in
>investigating the error:

>Dim conn As ADODB.Connection, cmd As ADODB.Command
>i = 0
>Do
>   i = i + 1
>   Set conn = New ADODB.Connection
>   conn.Open "Provider=SQLOLEDB; Data Source=gbzoswfi" & _
>             "; Initial Catalog=Test; User ID=Test;
Password=xxxxxxxx"

>   Set cmd = New ADODB.Command
>   Set cmd.ActiveConnection = conn
>   cmd.CommandText = "exec uspTestProc"
>   cmd.CommandType = adCmdText
>   cmd.Execute

>   Set cmd.ActiveConnection = Nothing
>   Set cmd = Nothing
>   conn.Close
>   Set conn = Nothing

>Loop Until i > 10000

>It is the conn.open statement that generates the error,
after about
>the 2000th iteration. Does anyone know what is causing
this?
>.



Wed, 28 Apr 2004 01:45:32 GMT  
 -2147467259 Unspecified error using ADO 2.5 connection object
Take a look at knowledge base Q186063.  There you'll find out how to
translate automation errors.

For your case, error -2147467259 (80004005 in hex) means "Unspecified
error".

And as a second thought, if you are using DataEnvironment, be advised of the
bugs....


Quote:
> I have a VB application that runs continually on a Windows NT Server
> and picks up messages from another server via TCP/IP (using Winsock).
> Every time it recieves a message it creates a connection to a SQL 7.0
> server database, and executes a stored procedure to update a table.
> After this it closes the connection, and awaits the next message.

> I have found that after about 2000 connections, the open statement
> generates an error with the description 'Unspecified Error' (Number
> -2147467259). To give an idea, here is some sample code I used in
> investigating the error:

> Dim conn As ADODB.Connection, cmd As ADODB.Command
> i = 0
> Do
>    i = i + 1
>    Set conn = New ADODB.Connection
>    conn.Open "Provider=SQLOLEDB; Data Source=gbzoswfi" & _
>              "; Initial Catalog=Test; User ID=Test; Password=xxxxxxxx"

>    Set cmd = New ADODB.Command
>    Set cmd.ActiveConnection = conn
>    cmd.CommandText = "exec uspTestProc"
>    cmd.CommandType = adCmdText
>    cmd.Execute

>    Set cmd.ActiveConnection = Nothing
>    Set cmd = Nothing
>    conn.Close
>    Set conn = Nothing

> Loop Until i > 10000

> It is the conn.open statement that generates the error, after about
> the 2000th iteration. Does anyone know what is causing this?



Wed, 28 Apr 2004 03:41:53 GMT  
 -2147467259 Unspecified error using ADO 2.5 connection object
Hi,

How about use conn.Execute to directly pass the action query to the
database without creating a command object.

In addition, I suggest you don't open and close the database connection
each time, since it is really time and  resource consuming. Instead, leave
the connection open and execute the query each time you receive a message.

Regards,
Steve

This posting is provided ?AS IS?, with no warranties, and confers no
rights.



Fri, 30 Apr 2004 15:54:38 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Unpredictable ADO error '-2147467259 - unspecified error'

2. System Error &H80004005(-2147467259) Unspecified Error

3. System Error &H80004005 (-2147467259) Unspecified Error

4. System Error &H80004005 (-2147467259) Unspecified Error

5. ActiveX Control Problem : [Unspecified Error : System Error &H80004005 (-2147467259) ]

6. ADO 2.5 'Unspecified Error' with Informix

7. Make EXE: System error &H80004005 (-2147467259) Unspecified error

8. &H800040005 (-2147467259) unspecified error

9. Command.Execute() and -2147467259 [Unspecified error]

10. Error -2147467259 - Could not find installable ISAM using ADO 2.1

11. Error -2147467259 - Could not find installable ISAM using ADO 2.1

12. ADO UpdateBatch error -2147467259 Native Error 1009

 

 
Powered by phpBB® Forum Software