CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Automatically update query in SQL Server

Print topic Send  topic

Author Message
Damo

Posts: 22
Posted: 06/03/2009, 4:53 AM

Hi

I have created a webpage that allows me to Update, Insert or Delete fields from a table. This works fine and updates the table in SQL Server 2005.

My problem is that my website uses tables and queries, when I update the table it does not update my query.

I have also tried making a webpage that updates the query, this works but it does not update the relating tables.

Does anyone know how I can get it to update both table and query?

The website is created using ASP. I have relationships in SQL Server 2005 so the tables should update the query.

Any help will be greatly appreciated.

Thanks
View profile  Send private message
ReneS

Posts: 225
Posted: 06/04/2009, 10:53 AM

Hi,

I think I don't really get your question...

A select query should merely reflect the data in the underlying tables, no "update" needed.
Do you use "views" in SQL server 2005 or custom sql statement in CCS?
Are you talking about refreshing the page? Do you use AJAX / update panels?

Can you give more info?

Rene
View profile  Send private message
Damo

Posts: 22
Posted: 06/05/2009, 12:49 AM

Hi,

Yes a select query does show my data on a webpage. My problem is that I need users to update information from the website.

As certain webpages display information from queries, I need to be able to update the new information to the queries and the tables that make up the query. So far I have only been able to update the tables or the query and not both.

If I was able to update the tables, is there a way to update or refresh the query held in SQL Server 2005 or update the query and refresh/update the tables?

I hope I have given you a better explanation of my problem and that you will be able to assist me.

Thanks in advance
View profile  Send private message
ReneS

Posts: 225
Posted: 06/05/2009, 3:07 AM

Hi,

Could you post your code for the query? Because to me it does not make sense that if you update a table, the view or query needs to be updated.... Right now i'm thinking that you just need to refresh your page.

Rene
View profile  Send private message
Damo

Posts: 22
Posted: 06/05/2009, 6:24 AM

Hi,

I will try to be a little clearer on the problem I am having:

I have two tables, table A and table B, I also have a query that contains fields from table a and from table b.

I have a webpage that displays data from the query, my problem is that I am trying to update the data through the webpage so a user can update the information themselves and keep the records up to date.

I have created a webpage using the grid and record builder in codecharge which allows you to insert, update and delete fields in that table or query you select.

I am able to insert, update and delete records for either a table or query depending on the datasource I chose when I set up the grid and record builder. The table or query changes are confirmed on the webpage and I can see the changes.

My problem is that if I choose to update table a or table b as the datasource the changes are not reflected in the query, so I can see the changes on the webpage that I updated but if I go to another webpage that displays information from the query and not the table I just updated you do not see the updated information, even though the query is based on the tables.

The problem seems to be that the query does not get updated information from the related tables. Is there a way to refresh/update the query with the updated information once any amendments gets made to the related tables?

I hope I have now fully explained my problem and that you can assist me.

Thanks
View profile  Send private message
peterr


Posts: 5971
Posted: 06/05/2009, 2:28 PM

Hi Damo,

What you described doesn't seem possible and there is no process for updating a query in any applications or databases. The job of any query is to retrieve the current data from multiple tables and the query cannot have its own data that needs updating. And tables cannot update a query as such concept doesn't exist.
So unless I don't understand this correctly, something seems to be wrong somewhere else and is not related to a lack of update. For example you may be mistaken about which tables the query is using, or you are using some type of page caching or non-standard data caching, or something else that I don't understand.

My recommendation would be to create a new temporary database with only the 2 tables and the query, stop your previous/main database to make sure that you are not connecting to it, then test your application with that temporary database. This should eliminate the possibility of looking at wrong tables, having the query based on wrong tables, having issues with database configuration, and possibly other sources of the problem.

Also, try viewing your query results directly in the database, without using ASP pages, to eliminate the possibility of your ASP pages being cached.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
ReneS

Posts: 225
Posted: 06/05/2009, 3:58 PM

Hi,

Peterr is (as us usual :-) right. If by any chance you are working with datasets, than things are different. However i don't think so. So read what Peterr said closely, and then again.....

Rene
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.

Web Database

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.