ADO connection err. in ASP but not in VB.net

T

toke

I've build a DLL in VB.net that handles all sorts of business logic.
This DLL accecesses a SQL server for some data in the following way:

<Begin pseudo-code snip>
Open a Connection
Con = new Connection (bla bla bla arguments)

'Make recordset 1 (using stored procedures, but only containing
"select" commands)
rs1 = new recordset
rs1.ActiveConnection = Con
bla bla bla
Open rs1

'Make recordset 2 using the same connection (using stored procedures,
but only containing "select" commands)
rs2 = new recordset
rs2.ActiveConnection = Con
bla bla bla
Open rs2

'Pass the rs into a delphi DLL that extracts information from the rs's
- only reading though
SomeResult = DelphiDLL.DoStuff(rs1,rs2,foo,bar)

'Clean up
Con.Close
Con = nothing
<End pesudo-code snip>

This works fine if I build a few win-forms and test the application
(even I a loop the app. and run it 2000 times, it works).

However, if I build some asp.net webforms, this code works some of the
time but not all!

It works almost everytime I start a completely new session (rebuild
the dll), but then it crashes if I run the page twice (that is, most
of the time - sometimes it works). Sometimes it even crashes the first
time around..... aaarggghhhhhh !!!

I've tried using two different connections (one for each rs), didn't
help - is this nessecary ? Or a bad idea ?

I've tried building a loop around the whole damn thing, looping 5-10
times if an Exception occured - works most of the time, but not all
(quite a few times it needs 1-3 attempts) before its running.

Any suggestions ??? Its driving me nuts ;/
tia,
t.

PS: The DLL originally was made for adodb 2.6 (correct number ? Or 2.7
??), but since it works flawlessly in VB.net it should be ok... at
least it seems like it from win-forms :)
 
P

Peter O'Reilly

If it's the same code running as a desktop application and an ASP.NET
application and an ADO.NET connection error, then chances are you need to
provide (greater) privileges to the aspnet work process account.
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top