INSERT/UPDATE

I have a form that pulls existing information from a database and allows users to edit it. Every field can be left blank if the user wishes.

I am having an issue with determining which SQL statement to run. There has to be an easier way to do this then what I am doing. For each filed I process the data this way:

SQL2="select * from 1985ClassList where MailingListID =" & Session("EID")
set aData = oConn.execute(SQL2)

Code:

View Replies


ADVERTISEMENT

Insert And Update In Asp

this programe is read date for excel and export to mdb,if there exist the BID in mdb then update the date,else inert the date to mdb. Code:

View Replies View Related

Asp Sql - Check If Update Else Insert..

I'm using a database to store the products in a basket.

It's this scenario:
A visitor already has some products in his basket and wants add some new ones.

Now, first I want to check if the selected products aren't already in the database.

1. if they are -> update the product when the amount number is changed
2. if the product is not in the database then insert it.

I'm stuck at the point that I can't retrieve if the database is updated, so I can either stop the query or insert the new product.

Java has a statement like getUpdateCount(), but ASP/VBSCRIPT??

I want the fastest solution, i dont want to retrieve the data twice and compare them to check if it changed..

View Replies View Related

INSERT/UPDATE Error In ASP

I try to do an INSERT statement throught my ASP to add records to my Access DB. However I get an error when I execute this. The code in ASP is -

strSQL = "INSERT INTO tbl_psm (LocID, Week, Month, Year, Rating, Remark, Action, SubmittedDateTime) VALUES ('" &cint(intLocid)& "', '" &cint(sWeek)& "', '" &cint(sMonth)& "', '" &cint(sYear)& "', '" &cint(sRating)& "', '" &sRemark& "', '" &sAction& "', '" &formatdatetime(date,vbshortdate)& "');"

objConn.Execute strSQL

I get the error page Code:

View Replies View Related

Insert And Update Error

I am submitting a comment box from a form into a database field that I have declared as text (16). When I type in a small amount of information, it submits just fine, but when I enter a substantial amount of data then I receive an error. I've tried different field types, but I keep getting the same error.

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 's'.

View Replies View Related

Insert/update Record

I have to compare 2 tables: orderA and orderB, if the record exists in both table orderB and orderA, just do a update to the quantity field in orderB (add orderA.quantity to orderB.quantity). Otherwise a new record has to be insert into orderB.

Do I have to loop through the recordset of orderB, then use select statement to see whether the record exists in orderA or not, and determine whether to update/insert record? I am using Access database. I just afraid that looping through each record in recordset (maybe >=30 record each time) would make the transaction getting slow (or even hang??). Can I do this in one SQL statement?

View Replies View Related

Insert And Update The Same Time

I want to insert the element selected by the user from the drop down box in the DB(Access).Once the user hits submit i want it to insert this in the DB + i want to update one of the fields from True to False . how can i perform both these at the same time?

View Replies View Related

After Insert - Update Another Site

The data that is entered into my website needs to be sent to someone else. Currently it is being put into a MySQL database. In addition to this, a third party needs this information. They have something set up on their website where I can do this:

https://www.domain.com/update.exe?src=username&data=Smith,John,5,12,Rose,Charlie

I have no control over domain.com. How can I update the record, send the data to this URL, and then redirect the user back to the default page? Right now it just inserts the record and then redirects to the default page. I'm unsure as to how to do the URL bit. I would prefer if the user did not see the domain switch.

View Replies View Related

Multiple Insert/Update

After the page (transactions.asp) loads I want to allow the user to enter the number of transactions into the provided textboxes. Then, when the user clicks submit, I need to have all the hidden fields as well as the number of transactions values inserted into the transactions table of my database?

I have attached the database should you have any questions about the db table values and fields. Please let me know if you have any questions or need more information or files.

View Replies View Related

Insert / Update / Delete

can u tell me of a simple script i can use to do the following. I want a textbox to add a entry to the database with a submit button, then below all that the current database entrys are listed below also in textboxes with a UPDATE and DELETE button beside each entry.

View Replies View Related

Insert And Update Excel Data

I didn't know how to use asp to update or insert the excel data ....

View Replies View Related

Update/Insert On MSSQL Table Using ASP Forms

I have a problem that it's bothering me for some time now and i will need a lot of help from you. I don't know how easy or difficult it is to be done but i would appreciate any help.

I have an mssql 2000 db with table "table1". Attributes for "table1" are:

ID (Primary Key)
field1
field2
field3
field4
field5
field6
field7

I'm trying through DreamWeaver MX to create a form through ASP and Text Fields, so that i can update "table1" through the form and also on another page to show the results of my table.

I have created a form which will be accepting 25 rows, each row having field1, field2, .., field7.

I cannot seem to get it to update "table1".

Any ideas how this can be done?

View Replies View Related

ASP - Date Formating MySql Insert/update

I am storing dates in a mySql database in the format yyyy-mm-dd. Now, I have set up so that this field is insert by a form.

It isn't very user friendly to have to type yyyy-mm-dd, how can I set up so that the user can enter format dd/mm/yyyy and it will automatically insert into the database as yyyy-mm-dd? I am using Dreamweaver MX 2004 and ASP.

View Replies View Related

Executing Sql Command -- Insert, Update And Delete

how can i make the function return true only if the execution is successfull (see bold red below)? Currently the function is returning true wheather it is successfull or not. Code:

View Replies View Related

How To Declare Session Variables And Use In Insert And Update

how to declare session variables and use it in insert and update sql statements... the scenario is I have:

2 html forms
2 ASP FILES

I am able to trap data from the first form into the acces table..but my second form(which is continuation of first form) has a update query....(ie...it shld update the same record the one inserted from the 1st form )..both the forms work on table in access db

its an annonymus...questionnaite...therefore i am not trapping any user name or login id...but the requirement is the survey made shld be unique....as in no user shld be able to answer the questions twice.

View Replies View Related

SQL Server - Update/Insert Multiple Cols Into Multiple Tables

Just as the title says I am trying to do something impossible with a single SQL statement. I am doing an ASP webpage for internal use at the company I work for.

I want to know if there is a way to insert/update data into multiple tables in 1 SQL statement.

If it requires functions | views or anything else that is fine but I don't want to have 3-4 different SQL statements to update 2-3 different columns in different tables.

View Replies View Related

How To Prevent Duplicate Values When Using BULK INSERT To Insert CSV To SQL Server?

How to prevent duplicate values when using BULK INSERT to insert CSV to SQL Server? Code:

View Replies View Related

How To Tie RegID To Form To Update (batch Update)

Okay there is an unique EventRegID for every registration. When people first register they get pre-registered. Then an admin comes in and confirms or wait list them (based on whatever requirements). My question is how can I tie the EventRegID to a form with multipule ID's so they can batch confirm or wait list the PreReg list? Code:

View Replies View Related

Getting Rid Of $ For An Update

I have this page that displays a dollor amount code:

<td class="tableValue" width="122">Expiring Premium:</td>
<td width="400" align="left">
<input name="Expiring_Premium" type="text" value="<%=formatcurrency(Expiring_Premium,2)%>" class="tableValue" size="27"></td>

it would display $100.00 when i go to insert that value into the database the value i get is $100.00 and i get an error, i need to get rid of the $ sign but not sure how to do it because the number range can be from 1 to a billion dollars.

I have this code for asp that if the value is null it insert a null instead of a blank, else i get an error message in access.

'Expiring_Premium = request.form("Expiring_Premium")
if (request.form("Expiring_Premium")) ="" then Expiring_Premium = "Null" else _
Expiring_Premium = request.form("Expiring_Premium")

Any ideas on how i can strip off the $

View Replies View Related

SQL Update

I'm looking to update a column in a datebase that has null values with N/A and I'm using this:

UPDATE tbl_members
SET branch_no = 'N/A'
WHERE branch_no = NULL

The only reason I'm trying to do this, is because I can't seem to do if statement on a null value.

View Replies View Related

Update Box

This is hard to explain, but I have wanted to know how to do this. Say you have a website, and you have a news box(where you can report all of your news), made of a picture(s), you know like something that says "news" at the top of the 'box', and the sides of the 'box' are a picture. I have wanted to know how to make one of these 'boxes' without having to use the <div> tag, and type as much text in there as i want, and it wouldnt mess up a table or anything, or realign it, because the <div> automatically wraps around the text, fitting perfectly to it. I was wondering if you can 'wrap' around the text without a <div>, but with pictures. Here is an example, this picture called ex.gif.
I know it is a link menu, but what if you wanted to add a couple more links. How would you get the 'box' to automatically resize so that it does not messup the table. I am not even sure if this is capable in ASP, but I am sure somebody knows what I am talking about.

View Replies View Related

Cannot Update

I have a guestbook form that inserts the fields into an
Access Database. The database is residing in the "fpdb"
folder that was created by FrontPage. The ASP page that
writes the data into the databse uses the
"recordset.addnew" method. The code was working fine a
couple of weeks ago, and now all of a sudden the error
message "Cannot update.Database or object is read-only"
pops up. The ASP code or the database was not changed or
modified in any way, neither were the permissions for the
account.

View Replies View Related

Asp Update

I have quite strange problem and hope you guys can help me out or provide me with some tips.
when using a update script:
UPDATE categorys SET main_cat_default= '0', banner= '', b_link= '', external_text= 'Nākotnes parks', name = 'Arzemju muzika' WHERE (id = 115)

Then it messes up field EXTERNAL_TEXT. Instead of Nākotnes parks it saves it as Nakotnes parks.
But! when I open Enterprise manager and type in Nākotnes parks manually then it saves it correctly. So I believe there is something with update command or smthing like that.I changed collation also to Latvian and this did not work.

View Replies View Related

Update My Own App

For laptop users who have an ASP application running on their laptops
- is there a way I can have it check when connected to the network
(via the FSO lastmodifieddate) which files need to be updated
(enhancements, etc.), then shoot the ASP pages that have changed down
to the client?

View Replies View Related

Update Db

I'm using the following code:

rs.addnew
rs("application")=body
rs.update


body is containing a lot of text with vbcrlf in it.This is basically a form that is emailed and I want to save it to a db just in case the emails don't go through.
For some reason the field in the db (access) is only containg the first line until the first vbcrlf

View Replies View Related

Will Not Update

I am updating some pages "font "style color size" and a few words in several of my asp pages. Most of them will update but I have a few that refuse to even after rebooting the server and clearing the cache on my current computer.

View Replies View Related

RSS Update

I was able to generate an RSS for the news I provide with ASP and MS SQL backend. When I opens it its working fine with any RSS reader, But its not getting updated, when I update the feed. Its showing the one which I made the day one, How to rectify and what could be the problem.

View Replies View Related

Sql Update

Any ideas why this is not working?

SQL = "UPDATE Answers SET Answer = '" & Replace(FieldValue, "'", "''") & "', UserName = '" & UserName & "', SurveyDate = '" & SurveyDate & "', Respondent = '" & Respondent & "', CompanyName = '" & CompanyName & "' WHERE QuestionID = " & QuestionID & " AND IntervieweeID = " & ID & " "

This is what it prints:

UPDATE Answers SET Answer = 'Answer Test', UserName = 'John Doe', SurveyDate = '08/03/2004', Respondent = 'Respondent Name', CompanyName = 'Company Name' WHERE QuestionID = 1705 AND IntervieweeID = 5

View Replies View Related

Get Value For Update

I have a database that has numbers in the fields, is there a way I can use the update command to take the value that is already in the field and add another value to that value. The value I want to add to the value alreay in the db is stored in a variable.

View Replies View Related

Update Does Not Update

What I'm trying to do: I have selected one record on the asp page and I want to replace that and save it to the same record. It is a table with two fields (Website and Updwebsite).

When I open the page, the correct data I want to edit is given, but when I change that and submit, the same data is returned and I even don't get an error on the page. So, I think it has something to do with the update query. Code:

View Replies View Related

Update SQL

how can i trigger a SQL (update query) by clicking a button in a asp page without further action in another asp page? Most grateful if some examples can be referred.

View Replies View Related

Update

Hey everyone I have a drop down menu that selects a few fields and displays the results in a table. Each product has a link to a page that displays all the information about it. I want to be able to update this information in this form. The problem i'm having is with the id, the id is passes from the table to the form, but when i go to update the "new" data i get an error that says: Syntax error (missing operator) in query expression 'ID ='. I'm assuming that this is due to the product id being lost, how do i pass that value on. my code:

View Replies View Related

Insert Into A Db...

Our graphic designer has just finished redeveloping our website. On the
site, we use SSL to secure the area where a user enters their personal
information to order items from us. (we do not do many transactions - maybe
1 per day...) We are a log home mfg company so they would only order plan
books, maybe a video etc...

When the user clicks "Submit Order", we want to encrypt each data item
(because of new legislation governing customer personal info etc...) and
write a record to an access db. From here it will be imported into our
Customer DB leads database...

I do not use ASP but program in VB 6 and Access 2000. ASP looks similiar in
many ways...

Does someone have a good ASP script for encrypting data? And, if so, is it
fairly strong encryption?

Also, is there any trick to writing an "insert" SQL script in ASP or is it
exactly the same as I would do in VB or Access? Maybe someone has an
"insert" script handy they could pass along including the command to
actually execute it?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved