Results 1 to 6 of 6

Thread: VB.NET Error

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    12

    VB.NET Error

    Anyone know what this means??

    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in adodb.dll

    Additional information: Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Are you using ASP 3.0? Do you have any code to post where it is bombing?

  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Check the access rights of the database you are trying to get data from. It may be read-only, or locked completely..

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    12

    Here is the code.

    Here is the code that is causing the error

    Rehire_Date(RehireDate1, Rec1.Fields("employee_number").Value, Rec1.Fields("company_number").Value)

    This line calls:

    Public Sub Rehire_Date(ByRef RehireDate As String, ByRef EmpNum As String, ByRef CompNum As String)

    When I step through the code, it will process the Sub but when it goes back to the Rehire_Date from above, that is when it generates the error. I am not trying to post information back to the database as I only have read access. I just need employee number and company number to be passed to the Rehire_Date Sub for processing, then continue on with the code. Thanks in Advance.

  5. #5
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    You declare all your variables as ByRef. EmpNum and CompNum should be ByVal - since you can't change them.

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    12

    Another

    That worked. Thanks. I guess when VB.NET upgraded the program it put ByRef. Changing it to ByVal fixed it. One other question that has been nagging me. Here is some database code the program connects to

    Public Sub OpenConnection(ByRef From As String)

    LogFile("OpenConnection(" & From & ")", True)

    DataConn = New ADODB.Connection
    DataConn2 = New ADODB.Connection
    Rec1 = New ADODB.Recordset
    Rec2 = New ADODB.Recordset
    Rec3 = New ADODB.Recordset
    Rec4 = New ADODB.Recordset

    'Connections to Database Production
    'DataConn.Open("Provider=OraOLEDB.Oracle;Password=######;User ID=######;Data Source=######;")
    'DataConn2.Open("Provider=OraOLEDB.Oracle;Password=######;User ID=######;Data Source=######;")

    LogFile("OpenConnection(" & From & ")", False)

    End Sub

    Public Sub CloseConnection(ByRef From As String)

    LogFile("CloseConneciton(" & From & ")", True)

    DataConn = Nothing
    DataConn2 = Nothing
    Rec1 = Nothing
    Rec2 = Nothing
    Rec3 = Nothing
    Rec4 = Nothing



    LogFile("CloseConnection(" & From & ")", False)

    End Sub

    I want to reclaim the memory that the Data Connections use,(This program runs 24 hours a day 7days a week) and I know that setting it to nothing sets it up for garbage collection. What is the next step to make sure that the memory is reclaimed.

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