Unspecified error when obtaining an ADO recordset from a C# progra

Unspecified error when obtaining an ADO recordset from a C# progra

Post by Q2hyaX » Sat, 26 Nov 2005 17:32:10


Hi,
I'm using an ADO DB connection in a C# program to retrieve records from
either an MS Access or MS SQL Server 2000 data source. The queries work fine
when tried out in the query analyzers for both data sources but fails within
the program at the point of performing the query:

rsOpen(sQuery.ToString(), m_Conn, ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockOptimistic, (int)ADODB.CommandTypeEnum.adCmdText);

A COMException is being raised, which outputs an 'Unspecified error' and
returns HResult = -2147467259 and _COMPlusExceptionCode = -532459699. Can you
give me more insight to this problem pls?

Thanks and Regards,
Chris
 
 
 

1. Can you create another ADO recordset from another ADO recordset

2. MS Access + ASP + ADO + OpenSchema + error - Unspecified Error

I am using MSAccess 2003 as my DB, ASP page my front end. My access file is
in the temp folder which ahs IUSR_Machine permissions. My asp page works
fine, connects to DB and retrieves what I want. Now, when I open my db file
in Microsoft Access in Exclusive mode my ASP page doest establish a
connection which is correct as exclusive open locks the files and prevents
further connections. Upto here no problem.


Now when I close that opened Microsoft Access instance, my web page resumes
working. If I refresh it, it works. The third time I refresh the page I get
"Unspecified Error". Again if I refresh it works and again if I refresh I
get "Unspecified error" when I debugged it fails at connection open.

Here is my code snippet..

if strConnString <> "" then
objConn.Mode = 3
objConn.ConnectionTimeout = 30
objConn.CursorLocation = 3 'adUseClient
objConn.open strConnString
set oTmpRs.ActiveConnection = objConn
Set oTmpRs = objConn.OpenSchema(4, Array(Empty, Empty,
tmpStrTable,Empty))
Set oTmpRs.ActiveConnection = Nothing
set rsColumns = oTmpRs.Clone
set oTmpRs = nothing
objConn.Close
end if

set objConn = nothing

Can anybody tell me what's wrong here..what could be the root cause of this
problem..

I tried almost all solutions I know and found in search engines..but not yet
solved this issue..

thanks

3. ADO recordset errors when trying to set to form recordset

4. Unspecified error during ADO Connection (the error show sometimes)

5. MS Access + ASP + ADO + OpenSchema + error - Unspecified Error

6. Can't obtain ADO recordset from remote site thru XML.

7. Mail merge using ADO recordset with word XP (visual C#)

8. Unspecified error on recordset open

9. ADO 2.7 C# - How Do I Create a Recordset On-the-Fly?

10. Unspecified error on recordset open

11. ADO unspecified error 259 -- NO known solution by Microsoft

12. ADO returns Unspecified error

13. Unspecified Error 80004005 - ADO Connection

14. ado + xp sp1 + sql server unspecified error