tags:

views:

829

answers:

3

I am doing some calculation with the data set I take from my database. Null values give errors so I tried replacing null values with zeros(0). Here is the error I get,

ADODB.Recordset error '800a0cb3'

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

Never seen it before. Here is my code.

If IsNull(objRevenueToday("REVENUE")) Then
 objRevenueToday("REVENUE") = 0
End If
+1  A: 

Your recordset appears to be read-only. There could be a number of reasons for this; you're reading a view that contains a Group By clause, you don't have permissions, etc.

Robert Harvey
Agreed, How did you open your database? Was the ADO cursor Readonly?
ssorrrell
A: 

Here is the solution:

If IsNull(objRevenueToday("REVENUE")) Then
RevenueToday = "0"
Else
RevenueToday = objRevenueToday("REVENUE")
End If

Not very ideal but fixed my error.

A: 

Assuming SQL Server (although similar techniques available in other DBs.

Change the query so that is will not return nulls in records. For example in the T-SQL

 SELECT ISNULL(REVENUE, 0), .... FROM ....
AnthonyWJones