|
-
Aug 23rd, 2004, 08:33 AM
#1
Thread Starter
Frenzied Member
ASP.NET application freezes!!
I need some urgent help here. For the past week I have been struggling with an asp.net application. Here are it's ingredients:
1)Asp.NET app running on windows 2003 server
2)ODBC Connection which enables communication with CA-IDMS ODBC Driver
3)IDMS Database
My test code is really simple. I create an odbc connection, perform conn.open, execute an sql statement to the CA-IDMS ODBC and some records are returned. Then I attempt to close the connection. Sounds easy, eh 
Here is what happens: If I run this code on my server in a winforms app, everything is working okay!
If I run it in an asp.net app, the app freezes on con.open , ISS freezes and no events whatsoever are fired... all that works is to restart the IIS...
Why are there any difference between opening odbc from asp.net and winforms? The code (except presentation layer) is 100 % the same!! All that is different is how the apps are executing... But Im not qualified enough to answer why winforms works and asp.net doesn't.
Here is what differs and stay the same:
Same:
ODBC (system dsn)
CA-Driver
win2003 server
business logic, data logic code
differs:
winforms vs asp.net
Please, Im really desperate! Is there any setting in the framework, IIS or windows server that differs??? What can I do??
kind regards!
Henrik
-
Aug 23rd, 2004, 09:55 AM
#2
I wonder how many charact
My first guess would be permissions, the freezing kinda eludes me however, I would think it would return a permission error if you were in debug mode, but then I don't have access to your code to see.
Anyway, ASP.NET runs under its own priviledges, seperate from Forms apps that run as the current user. In some networks, ASP.NET has less permissions than a windows user.
For your testing on a Windows Forms app, are you an administrator on 2003 server, and if not, what exactly are your permission levels?
-
Aug 24th, 2004, 12:05 AM
#3
Thread Starter
Frenzied Member
Thanks for you reply. You see, our current windows server admin is out of office... So until he gets back I have to fix this myself.
Please walk me through how I check exactly what kind of persmissions I have... The ASPNET account is a member of the group "Users"... thats about everything I have found out...
I can check or test anything you want, please walk me through it... and here is my code:
VB Code:
Imports System.Diagnostics
Imports System.Data.Odbc
Public Class WebForm1
Inherits System.Web.UI.Page
Dim evlog As New EventLog("IDMSTest", ".", "IDMSTest")
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Connectionobject
Dim con As New OdbcConnection
'Define a handler for the event
AddHandler con.StateChange, AddressOf OnStateChanged
AddHandler con.InfoMessage, AddressOf OnInfoMessage
'Define the connection
With con
.ConnectionString = "dsn=IDMS Sys02;pwd=gps20103;uid=LGGPSUSR"
.ConnectionTimeout = 10
End With
Try
'delete any old logs
'evlog.Delete("IDMSTestWeb")
LogMessage("Attempting to open connection")
con.Open()
LogMessage("Connection is opened")
Catch ex As Exception
LogMessage(ex.Message)
Finally
con.Close()
con.Dispose()
LogMessage("Connection is closed")
evlog.Close()
evlog.Dispose()
End Try
End Sub
Private Sub LogMessage(ByVal message As String)
evlog.WriteEntry("IDMSTest", message)
End Sub
Public Sub OnStateChanged(ByVal sender As Object, ByVal e As StateChangeEventArgs)
LogMessage("State changed to: " & e.CurrentState)
End Sub
Public Sub OnInfoMessage(ByVal sender As Object, ByVal e As OdbcInfoMessageEventArgs)
LogMessage("ODBC InfoMessage: " & e.Message)
End Sub
End Class
I have added some eventhandlers for the odbc object...
What about the odbc? It should be system dsn.. not user dsn?
kind regards
Henrik
-
Aug 24th, 2004, 08:00 AM
#4
I wonder how many charact
It should be System DSN...
Check Data Sources under Administrative tools...
-
Aug 24th, 2004, 08:10 AM
#5
I wonder how many charact
Also be sure the username and password for the data source are correct, because Forms could revert to Windows Authentication, wheras perhaps the ASPNET user cannot.
-
Aug 24th, 2004, 08:17 AM
#6
Thread Starter
Frenzied Member
Problem solved! I had to use the identity tag in web.config and enable impersonation and run the web app with a special user that has more rights than the standard aspnet user... Now everything works!!
thanks for your help
Henrik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|