OleDbConnection Good, SQLConnection Bad??

L

Ludvig

This Exception is executed when using SQLConnection.
OleDbConnection connects fine.

[FileNotFoundException: The specified module could not be found.]
System.EnterpriseServices.Platform.Initialize() +503
System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate cb)
+11
System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl) +797
System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl
ctrl) +170

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) +358
System.Data.SqlClient.SqlConnection.Open() +384
component_net.test.GetSingleValueStringX(String sTable, String
sFieldToGet, String sFieldToFind, String sValueToFind)
component_net.test.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
 
P

Patrice

Usually it just works ;-)

The few lines surrounding the call raising this exception would help. My
wild wild guess would be a connection string issue.

Patrice
 
L

Ludvig

Thanks for your replay.
SQLConnection works on our develop machine.
This problem occurred after a hacker attack on our public server.
After reinstalling the framework, everything seems to be ok, except
SQLConnection.
To track this problem down, I tried to connect with OleDbConnection instead,
and that did work.
Maybe there is a corrupt DLL or something.
I just can't figure out what to do to solve this problem, based on the
"Stack Trace"



--------------------------
The SQLConnection issue commented out...


'conString = ("server=MyServer;uid=USER;pwd=pass;database=MyDB")
conString = ("Provider=SQLOLEDB;data
source=MyServer;database=MyDB;uid=USER;pwd=pass")


Dim XstrSQL As String = "SELECT * FROM users WHERE User_ID=1"

Dim conO As New OleDb.OleDbConnection(conString)
Dim conC As New OleDb.OleDbCommand(XstrSQL, conO)

Try

conO.Open()
Dim conDR As OleDb.OleDbDataReader
conDR = conC.ExecuteReader(CommandBehavior.CloseConnection)
While conDR.Read()
Test = conDR("User_Name")
End While

Response.Write(Test)

Catch sx As System.IO.FileNotFoundException
Response.Write(sx.StackTrace & "<br><br>" & sx.Message)
End Try


'Dim XscnnNW As New SqlConnection(conString)
'Dim Xscmd As New SqlCommand(XstrSQL, XscnnNW)
'Dim XobjDR As SqlDataReader

'Try

'XscnnNW.Open()
'XobjDR = Xscmd.ExecuteReader(CommandBehavior.CloseConnection)
'While XobjDR.Read()
'Test = XobjDR("User_Name")
'End While

'Catch sx As System.IO.FileNotFoundException
Response.Write(sx.StackTrace & "<br><br>" & sx.Message)
'Finally
'Xscmd.Dispose()
'XscnnNW.Dispose()
'End Try


Patrice said:
Usually it just works ;-)

The few lines surrounding the call raising this exception would help. My
wild wild guess would be a connection string issue.

Patrice

--

Ludvig said:
This Exception is executed when using SQLConnection.
OleDbConnection connects fine.

[FileNotFoundException: The specified module could not be found.]
System.EnterpriseServices.Platform.Initialize() +503
System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate cb)
+11
System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl) +797
System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl
ctrl) +170
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) +358
System.Data.SqlClient.SqlConnection.Open() +384
component_net.test.GetSingleValueStringX(String sTable, String
sFieldToGet, String sFieldToFind, String sValueToFind)
component_net.test.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
 
G

Guest

After couple of hours assembly language debugging, figured out that it throws
that exception because a call to native Win32 API LoadLibraryW was failing.
The LoadLibraryW was trying to load \WINNT\SYSTEM32\COM\comadmin.dll. Once
I copied that DLL from another system, it worked like a charm.

Hope this helps others.

P

Ludvig said:
Thanks for your replay.
SQLConnection works on our develop machine.
This problem occurred after a hacker attack on our public server.
After reinstalling the framework, everything seems to be ok, except
SQLConnection.
To track this problem down, I tried to connect with OleDbConnection instead,
and that did work.
Maybe there is a corrupt DLL or something.
I just can't figure out what to do to solve this problem, based on the
"Stack Trace"



--------------------------
The SQLConnection issue commented out...


'conString = ("server=MyServer;uid=USER;pwd=pass;database=MyDB")
conString = ("Provider=SQLOLEDB;data
source=MyServer;database=MyDB;uid=USER;pwd=pass")


Dim XstrSQL As String = "SELECT * FROM users WHERE User_ID=1"

Dim conO As New OleDb.OleDbConnection(conString)
Dim conC As New OleDb.OleDbCommand(XstrSQL, conO)

Try

conO.Open()
Dim conDR As OleDb.OleDbDataReader
conDR = conC.ExecuteReader(CommandBehavior.CloseConnection)
While conDR.Read()
Test = conDR("User_Name")
End While

Response.Write(Test)

Catch sx As System.IO.FileNotFoundException
Response.Write(sx.StackTrace & "<br><br>" & sx.Message)
End Try


'Dim XscnnNW As New SqlConnection(conString)
'Dim Xscmd As New SqlCommand(XstrSQL, XscnnNW)
'Dim XobjDR As SqlDataReader

'Try

'XscnnNW.Open()
'XobjDR = Xscmd.ExecuteReader(CommandBehavior.CloseConnection)
'While XobjDR.Read()
'Test = XobjDR("User_Name")
'End While

'Catch sx As System.IO.FileNotFoundException
Response.Write(sx.StackTrace & "<br><br>" & sx.Message)
'Finally
'Xscmd.Dispose()
'XscnnNW.Dispose()
'End Try


Patrice said:
Usually it just works ;-)

The few lines surrounding the call raising this exception would help. My
wild wild guess would be a connection string issue.

Patrice

--

Ludvig said:
This Exception is executed when using SQLConnection.
OleDbConnection connects fine.

[FileNotFoundException: The specified module could not be found.]
System.EnterpriseServices.Platform.Initialize() +503
System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate cb)
+11
System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl) +797
System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl
ctrl) +170
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) +358
System.Data.SqlClient.SqlConnection.Open() +384
component_net.test.GetSingleValueStringX(String sTable, String
sFieldToGet, String sFieldToFind, String sValueToFind)
component_net.test.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top