473,799 Members | 3,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

database update issue

18 New Member
greetings.
I am having an issue with a piece of code, I was hoping someone can show me where I am going wrong. Basically I select 9 rows of data out of a table that have the same item number, but each row has a unique GUIDs, then I loop through the data to display it on a webpage. This all works fine.

The issues comes when I try to submit all the data (changed or not) back into the table. My submit code is below


strcreative_id = Request.Form("c reative_id")
strcreative_run time = Request.Form("c reative_runtime ")
strcreative_sta te = Request.Form("c reative_state")
strcreative_tex t_data = Replace(Request .Form("creative _text_data"),"' ","''")
strcreative_tex t_effects = Request.Form("c reative_text_ef fects")
strcreative_ima ge_name = Request.Form("c reative_image_n ame")
strcreative_gui d = Request.Form("c reative_guid")

' Build our SQL String
strSQL = ""
strSQL = strSQL & "UPDATE tbl_advert_setu p_creatives "
strSQL = strSQL & "SET creative_runtim e ='" & strcreative_run time & "'"
strSQL = strSQL & ", "
strSQL = strSQL & "creative_s tate ='" & strcreative_sta te & "'"
strSQL = strSQL & ", "
strSQL = strSQL & "creative_text_ data ='" & strcreative_tex t_data & "'"
strSQL = strSQL & ", "
strSQL = strSQL & "creative_text_ effects ='" & strcreative_tex t_effects & "'"
strSQL = strSQL & ", "
strSQL = strSQL & "creative_image _name ='" & strcreative_ima ge_name & "'"
strSQL = strSQL & "Where creative_guid = '" & strcreative_gui d & "';"

Response.Write strSQL

%>


The Response.Write produces this:

UPDATE tbl_advert_setu p_creatives SET creative_runtim e ='30, 60, 23, 60, 240, 33, 90, 22, 60', creative_state ='1, 1, 0, 1, 1, 0, 1, 1', creative_text_d ata ='tires, today only!!, Buy some today...please. , 75006, Obamas Transition Chief., Everyone is reviewing can.', creative_text_e ffects ='Stretch, Stretch, Inset', creative_image_ name ='2.jpg, 3.jpg, 5.jpg, 1.jpg'While creative_guid = '{B53BA5B7-6971-4442-9A0F-83EAF27E2F0E}, {8E123F5C-25BB-4CCD-A443-77C9D0961002}, {53D1FB08-2998-49CB-8D78-D128FAAF6232}, {693BD709-C65D-438F-AC3F-817C849B2ECE}, {9C7B4C1E-A466-4854-BDCE-250661639490}, {27448802-E779-4AFE-A147-41410CEE81A9}, {FF4F7F87-1FB2-4902-8055-2F688920A014}, {8CBF7404-2CDC-42DC-9DE1-8AEDA0B148DB}, {4440412C-951C-46BF-8935-F401D850815B}, {BEF028CB-DAF3-470E-B18D-DD9806DD9B04}';

How do I get the data back into each specific row of my db? It is trying to stuff all 9 rows of data back into the first row. The creative_guid column is a unique identifier.
I guess I need some sort of update loop statement, but can’t figure it out. when i add "Do while not Rs.EOF" to the update (above strcreative_id = Request.Form("c reative_id")) it says "Operation is not allowed when the object is closed. " the RS is not closed as best as i can tell.

thanks for any help.

P
Jan 6 '09
10 2236
Nicodemas
164 Recognized Expert New Member
What's being entered into the database was expected. If what you are seeing on the actual web page is different, there is a script between what you extract from the database and what you print to the response buffer that is removing that apostrophe - perhaps another replace()?
Jan 20 '09 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

16
7524
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I have an series of interactive HTML forms. The user begins a Cookie session. A database connection is opened and a transaction is begun. After the user goes through any number of pages where they update the database they finish on a page where...
4
2626
by: Frnak McKenney | last post by:
I'm using an in-core DataSet as an image of my application's 'database' (a multi-table Access97 mdb file). Updates are made to the DataTables within the DataSet via forms with bound TextBoxes, then written to the database... or at least that's what's supposed to be happening. Unfortunately, I've discovered that while it appears that when I create a new record/row I'm successfully updating the Access database, once the Update is...
2
4869
by: vrbala | last post by:
Hi All, I have a issue in federated database. I will explain the scenario I have a table T1 in database called offlinedb. It has one column F1 I have an another table T2 in database uatdb. I added attached table T1 in offlinedb using Federated Objects. Then i created a procedure P1 in uatdb database with the following contents.
3
13087
by: Tc | last post by:
Hi, I was curious, I am thinking of writing an application that loads a dataset from a database that resides on a server. The question I have is this, if multiple copies of the app will be running at once will there be problems with data updates? The reason I ask is I'm thinking like this: User1 launches the app and the dataset is created from the data in the DB.
3
1634
by: Simon | last post by:
Hi everyone, I have a small problem regarding a wizard that I'm making on my website. The wizard is obviously a series of pages that take values from the user. My question is: - Should I store all the values entered until the last page and then update the database, or should I do it as I go.
13
2672
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value. My probelm.... when I have the user press the update button (which does a post back that loops through the datagrid and updates a database) the field/cell that is filled by the javascript appears to be blank in my update code, even though I can...
0
1513
by: Gagan Sindhu Dewangan | last post by:
Below is the following procedure where I am facing the problem, the work of the below procedure is to update the database. query result:sp_helptext bProjectUpdate Text ...
10
4304
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the application looks for existing rows in the table...if they already exist then it updates otherwise inserts them. The table is pretty large, around 6.5 million rows.
25
2814
by: pereges | last post by:
Hello, I'm trying to build a database driven website for a library management system. The database is stored on a remote server which all of my team mates can access. I've installed MySQL, PHP and Apache on my machine. I'm a beginner and I really don't understand how to proceed. My biggest problem is how to connect to the database on remote mysql server ? Does php allow this kind of thing ? I'm interested in a web interface on my machine...
0
2904
by: imusion | last post by:
Hi, I have 2 servers each running AIX and both have a DB2 database setup on them. I'm building a news management application and in our setup we need to have a staging and production setup. So the staging database gets the changes performed and then once we're satisfied with how it looks, we push the changes through SQL queries which perform the (deletions, updating, and inserting of articles) onto the production database by comparing it to...
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10243
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9078
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.