Sql – Recordset in VB6.0

recordsetsqlvb6

I'm retrieving Data from a Database in a record set using VB6… so while retrieving data using Select in SQL I added a column called Comments along wit it so that in the recordset, all the columns of the table+'Comments' column would be present… I don't want to(and also I cannot) update any contents in the database as i'm only 'fetching' data frm the database now…

Now when i pass the fetched data for validation, I want to fill the 'comments' Column with the respective errors if the particular row in the recordSet is erroneous)…. When i do that i get an error saying "I'm not authorized to do that!!(to update the 'Comments' Column"….

Now My Question is "In what way i can solve this problem???".. I tried to replicate this recordset and there by now filling the 'comments'column (in the replicated one) which in turn showed the same error… It seems this could be because the duplicate one(recordSet) just retains the properties of the original one…

Can u any1 help how to solve this???? Any ways to replicate the recordset(without inheriting its properties something)??????

Best Solution

I think you are just asking how to do a disconnected recordset. For that you just change the cursor location of the recordset.

Dim rstTest as ADODB.RecordSet
Set rstTest = New ADODB.RecordSet
With rstTest
   .CursorLocation = adUseClient
   .Open "your sql here", your_connection_object, adOpenStatic, adLockBatchOptimistic, adCmdText
   ' now disconnect it and force the local copy
   .ActiveConnection = Nothing
End With