You can bind the datagrid to a dataset and send the delta packet (any
additions, deletions, or changes) back to the server. The binding takes care of
tracking the changes, so you don't have to loop through the grid.
Good luck!
Call Me Mad - 19 Mar 2005 04:02 GMT
I must be a little dense today. I am using a dataset but still can't write all
records in one operation. As a temporary solution I am using the following code
to step through each record.
myDataSet.first();
while(myDataSet.hasNext()) {
myAddRemoteConnector.trigger();
myDataSet.next();
}
I am using a coldfusion.cfc with the following:
<cffunction access="remote" name="addMyRecord" output="false">
<cfargument name="keyField1" type="string" required="yes" default="">
<cfargument name="KeyField2" type="string" required="yes" default="">
<cfargument name="Field3" type="string" required="yes" default="">
<cfargument name="Field4" type="string" required="yes" default="">
<cfquery name="addMyRecord" datasource="WebCollect">
INSERT INTO dbo.myTable
(KeyField1,KeyField2,Field3,Field4)
VALUES
'#arguments.KeyField1#', '#arguments.KeyField2#', '#arguments.Field3#',
'#arguments.Field4#')
</cfquery>
</cffunction>
That's potentially a lot of calls to your server and you probably want to
minimize those. The Update Packet (basically an XML file) is much smoother.
Flash passes just the delta, just th ethings that have changed, in the data set
back to CF. You need an XML parser to accept the packet and deal with it, but
once you write it, you've got it for all your projects. Here, take a look at
this tutorial for ideas:
http://www.macromedia.com/devnet/mx/flash/articles/delta_packet.html
Hope it helps!
Call Me Mad - 24 Mar 2005 05:58 GMT
Thank you for your reply David, I really do appreciate the help. I did play
with the RDBMSProcessor about 6 months ago with some success. Unfortunately,
tonight, trying to convert the sample code to Flash Player 7 is making me crazy
:). I'll try again tomorrow and the day after that and the day after that until
I get it right.
Thanks Again.
Tom Coleman - 24 Mar 2005 20:31 GMT
I think this tutorial is a little more up-to-date (FMX2K/AS2 style):
<http://www.macromedia.com/devnet/mx/coldfusion/articles/dc_wizard.html>
HTH,
Tom
> That's potentially a lot of calls to your server and you probably want to
> minimize those. The Update Packet (basically an XML file) is much smoother.
[quoted text clipped - 6 lines]
>
> Hope it helps!