I've a website in vb.net. While running the website i get the following error:
"Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype."
My DB connection.inc file looks as follows:
<%@ Import namespace="ADODB" %>
Dim strDataSource As String Dim cnnCRM As ADODB.Connection<% cnnCRM = New ADODB.Connection strDataSource = Server.MapPath(".") & "/database/crm.mdb" 'strDataSource="c://crm/crm.mdb" cnnCRM.Open("PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & strDataSource) %>
I've tried giving the record set object all the properties it required. Still the same error. Can anybody tell me how i can get rid of this error?.....
DB has full permissions. This error happened when i called a function.My code is shown below:
<%=(funcGetMaxDate(rstAWCList.Fields("TOMONTH").Value, rstAWCList.Fields("TOYEAR").Value) & "/" & IIF(IsDBNull(rstAWCList.Fields.Item("TOMONTH").Value), Nothing, rstAWCList.Fields.Item("TOMONTH").Value) & "/" & IIF(IsDBNull(rstAWCList.Fields.Item("TOYEAR").Value), Nothing, rstAWCList.Fields.Item("TOYEAR").Value))%>
The definiton works perfectly. The function definition is as follows:
Function funcGetMaxDate(ByRef prmMonth As String, ByRef prmYear As String) As String Dim intPrmMonth As Integer intPrmMonth =prmMonth Dim iDate As String
Select Case intPrmMonth
Case 1
iDate = 31
Case 2
iDate = CheckMaxDateFebruary(prmYear)
Case 3
iDate = 31
Case 4
iDate = 30
Case 5
iDate = 31
Case 6
iDate = 30
Case 7
iDate = 31
Case 8
iDate = 31
Case 9
iDate = 30
Case 10
iDate = 31
Case 11
iDate = 30
Case 12
iDate = 31
Case Else
iDate = 0
End Select
funcGetMaxDate = iDate
End Function
When the ctrl reaches back the calling function this exception occurs.....