Results 1 to 6 of 6

Thread: ASP.NET application freezes!!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Exclamation 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

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    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?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    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:
    1. Imports System.Diagnostics
    2. Imports System.Data.Odbc
    3. Public Class WebForm1
    4.     Inherits System.Web.UI.Page
    5.     Dim evlog As New EventLog("IDMSTest", ".", "IDMSTest")
    6. #Region " Web Form Designer Generated Code "
    7.  
    8.     'This call is required by the Web Form Designer.
    9.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    10.  
    11.     End Sub
    12.     Protected WithEvents Button1 As System.Web.UI.WebControls.Button
    13.  
    14.     'NOTE: The following placeholder declaration is required by the Web Form Designer.
    15.     'Do not delete or move it.
    16.     Private designerPlaceholderDeclaration As System.Object
    17.  
    18.     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    19.         'CODEGEN: This method call is required by the Web Form Designer
    20.         'Do not modify it using the code editor.
    21.         InitializeComponent()
    22.     End Sub
    23.  
    24. #End Region
    25.  
    26.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    27.         'Put user code to initialize the page here
    28.     End Sub
    29.  
    30.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    31.         'Connectionobject
    32.         Dim con As New OdbcConnection
    33.         'Define a handler for the event
    34.         AddHandler con.StateChange, AddressOf OnStateChanged
    35.         AddHandler con.InfoMessage, AddressOf OnInfoMessage
    36.         'Define the connection
    37.         With con
    38.             .ConnectionString = "dsn=IDMS Sys02;pwd=gps20103;uid=LGGPSUSR"
    39.             .ConnectionTimeout = 10
    40.         End With
    41.         Try
    42.             'delete any old logs
    43.             'evlog.Delete("IDMSTestWeb")
    44.             LogMessage("Attempting to open connection")
    45.             con.Open()
    46.             LogMessage("Connection is opened")
    47.         Catch ex As Exception
    48.             LogMessage(ex.Message)
    49.         Finally
    50.             con.Close()
    51.             con.Dispose()
    52.             LogMessage("Connection is closed")
    53.             evlog.Close()
    54.             evlog.Dispose()
    55.         End Try
    56.     End Sub
    57.     Private Sub LogMessage(ByVal message As String)
    58.         evlog.WriteEntry("IDMSTest", message)
    59.     End Sub
    60.  
    61.     Public Sub OnStateChanged(ByVal sender As Object, ByVal e As StateChangeEventArgs)
    62.         LogMessage("State changed to: " & e.CurrentState)
    63.     End Sub
    64.  
    65.     Public Sub OnInfoMessage(ByVal sender As Object, ByVal e As OdbcInfoMessageEventArgs)
    66.         LogMessage("ODBC InfoMessage: " & e.Message)
    67.     End Sub
    68.  
    69.  
    70.  
    71. 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

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    It should be System DSN...

    Check Data Sources under Administrative tools...

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    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.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    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
  •  



Click Here to Expand Forum to Full Width