-
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.
-
Are you using ASP 3.0? Do you have any code to post where it is bombing?
-
Check the access rights of the database you are trying to get data from. It may be read-only, or locked completely..
Phreak
-
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.
-
You declare all your variables as ByRef. EmpNum and CompNum should be ByVal - since you can't change them.
-
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.