Results 1 to 3 of 3

Thread: Aspx use same Class Library instance ??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    19

    Aspx use same Class Library instance ??

    hi,

    i'm using aspx with a class library project.

    Problem:
    Every user uses the same instance of the class library project, so i get errors like (Object not set to an instance of an object, although it is set correct, but the other user already destroyed it, because he didn't need it anymore, etc.). I get this errors only if i simulate 2 Users. With one User all works fine. But if the second one want to use the class library then it crashes.

    So how can i tell the webservices to use everytime a new instance of the VB Class Library ?
    (At the moment i'm using in the asp.net pages something like that: Dim ocontrol as New DllProject.Dllclass() and then Dim dummystring as String = ocontrol.checku("asas","asas") )

    Or need i to change something in the VBProject ?

    Thanks in advance.
    Oliver

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I don't think that the problem is a shared instance. Your code creates a new instance before it uses it so even if one user shared the same instance and that instance was destroyed then it would recreate it. Are you putting this code in a module or a page? Module level code 'may' be shared across multiple sesssions but page variables aren't.

    Post either part of your project or the exact code giving you trouble. Also the method you are using to test with multiple users.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    19
    i tested it and the problem seems to be ado. I upgraded the project and use the old ado with recordsets:

    Public con As ADODB.Connection
    Public odbpath As String

    Sub dbopen(ByVal cdbpath As String)
    con = CreateObject("ADODB.Connection")
    con.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & odbpath & ";Jet OLEDBatabase Password=")
    End Sub

    Sub dbclose()
    con.Close()
    con = Nothing
    End Sub

    Everytime there is a DB Access => Error

    So i will try to make a workaround.

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