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

John Colby jwcolby at ColbyConsulting.com
Tue Oct 18 07:13:15 CDT 2005


IIRC a clone is just a pointer to the same data set.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Paul Hartland
(ISHARP)
Sent: Tuesday, October 18, 2005 4: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