CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Editable grid custom insert

Print topic Send  topic

Author Message
netsys

Posts: 39
Posted: 07/10/2012, 1:47 PM

I'm using an editable grid with a custom insert to save multiple dates for scheduled classes to a child table. I'm also using a SQL insert statement in the on-click server event of the form's submit button. The SQL insert statement saves other data about the class to the parent record. I had this working, but in changing to a new driver (mandated by the Web host), I'm finding this isn't working anymore.

Previously, the SQL insert into the parent table, which took place in the on-click server event, would happen, then the regular insert from the editable grid would take place. I am creating a multi-digit number, saving it as a session value, then having the SQL insert write it to the parent table. Then, I have the regular insert check that value against the value in the parent table, and look up the class ID based on this match.

However, it seems that the write order isn't working the way it was before with the new driver, as I'm not getting the class ID into the regular insert anymore - no value is written to the table. I tried a CCDLookup Max function instead, to see if I could get the value, but found I was getting the previous entry's class ID. This makes me think the regular insert is happening before the custom insert, as I'm not getting the class ID I'm creating with the custom insert.

Any ideas on how to get the custom SQL insert to happen before the regular insert? I've tried moving it to different functions, including Before Submit, Before Build Insert, etc., with no luck.

Anyone have ideas on this? Thanks very much.
View profile  Send private message
netsys

Posts: 39
Posted: 07/11/2012, 1:46 PM

I've realized that the problem is this:

Once I write the data using my custom SQL insert, the data is written to the parent table, but if I go ahead and do a CCDLookup max to see the latest entry, I get the previous entry, not the last entry. Therefore, I don't get any data in my query, because it can't match up the unique generated number.

For some reason, I insert the data in the table, and I can see it there, but programmatically, I don't see the latest data. I close the connection after the Connection.Execute(SQL) command.

Any ideas how I can get the latest data for use by another script after this custom insert runs?
View profile  Send private message
netsys

Posts: 39
Posted: 07/11/2012, 1:46 PM

I've realized that the problem is this:

Once I write the data using my custom SQL insert, the data is written to the parent table, but if I go ahead and do a CCDLookup max to see the latest entry, I get the previous entry, not the last entry. Therefore, I don't get any data in my query, because it can't match up the unique generated number.

For some reason, I insert the data in the table, and I can see it there, but programmatically, I don't see the latest data. I close the connection after the Connection.Execute command.

Any ideas how I can get the latest data for use by another script after this custom insert runs?
View profile  Send private message
netsys

Posts: 39
Posted: 07/11/2012, 1:47 PM

I've realized that the problem is this:

Once I write the data using my custom SQL insert, the data is written to the parent table, but if I go ahead and do a CCDLookup max to see the latest entry, I get the previous entry, not the last entry. Therefore, I don't get any data in my query, because it can't match up the unique generated number.

For some reason, I insert the data in the table, and I can see it there, but programmatically, I don't see the latest data. I close the connection after the execute command.

Any ideas how I can get the latest data for use by another script after this custom insert runs?
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.