[AccessD] OT - Visual Basic Recordset & Recordset Clone.

DWUTKA at marlow.com DWUTKA at marlow.com
Wed Oct 19 12:17:20 CDT 2005


Just a thought, instead of using the interface for the audit, use triggers
instead, to create your audit trail.  Triggers on the SQL Server would be a
much more 'bullet proof' approach for an actual audit trail.

Drew

-----Original Message-----
From: Paul Hartland (ISHARP) [mailto:paul.hartland at isharp.co.uk]
Sent: Tuesday, October 18, 2005 3:39 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] OT - Visual Basic Recordset & Recordset Clone.


To all,

I am writing a particularly small application using Visual Basic 6.0 and SQL
Server to keep track of our client costs (what we charge per man day etc
etc)....and have to keep an audit trail of anything that gets changed, I
thought I would try a recordset clone approach based on the following:

	1.	User finds the client, and recordset stored in an ADODB data
control.
	2.	Before user does anything get a clone of the recordset (read
only).
	3.	When the user finds another record, or selects another menu
option.  Loop through the fields to look for the differences...

This is where I am a bit confused the recordset clone seems to also be
updating even though I have told it to be read only.....

Am I going about this the totally wrong way ?, is there a better way
?....Can someone offer me advice and/or sample code to how they would go
about checking each individual field to see if it's been changed....

The code below just uses a msgbox to display on screen (after the
ADODB.Recordset.Update has processed)

(rsCheck is the clone)

For intFld = 0 To rsCheck.Fields.Count - 2
        MsgBox rsCheck.Fields(intFld).Name & vbCrLf & _
                     frmCBClient.ADO_Client.Recordset.Fields(intFld).Name &
vbCrLf & _
                     rsCheck.Fields(intFld) & vbCrLf & _
                     frmCBClient.ADO_Client.Recordset.Fields(intFld)
Next intFld

Thanks in advance for any help on this 

Paul Hartland

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list