Using Multiple INSERT In An If Then End If

This is my code, for some reason, when I use this exact code it doesn't update my database, but if I use the next section of code it does. Anybody knows why that when I use two different "Insert" in If Then End If, it doesn't work? Oh and I did try the "If PID = 105 OR 151 Then" alone and it works well. Code:

View Replies


ADVERTISEMENT

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

Multiple Insert Into DB

I hv a SQL server table 'spmidishad'. Theere are 7 columns. One of it is Partner. my searchresults.asp displays all the records retrived from my database (spmidishad). At the end of one row, there is a checkbox. Once a few is checked, i will press on the IMPORT button. This import button (the form action is from import.asp)
is to import (insert) all the checked records into the database.. All rows inserted (the data) are the same except for the Partner column.Well, i want someone who can help me to figure out how I am suppose to do this..?

View Replies View Related

Multiple Insert

I have a page that will populate information from a "reference" table in the DB (SQL) like this:

sku qty
123 10
111 10
222 10
333 10

This information will be different each time the page is visited based on the variable they submit. So next time it may show 20 records. how would I go about inserting this data to the DB? Can anyone point me in the right direction to get me started?

View Replies View Related

Multiple File Name Insert

I'm trying to make a form that allows the user to select multiple files from their computer, and then INSERTS those file names into an access database using ASP. I also don't want to have a seperate <input = file> tag for each one??? Is this possible?

View Replies View Related

Insert Multiple Records

I'm trying to set up a form whereby users can select a variety of different subject mailing lists they'd like to be added to.
Each subject is in a different table so I want the FROM part of my SQL statement to loop through the values selected from the list box which I've loaded into an array.
But I'm getting a Type mismatch error.Code:

Dim strSQL
Dim subjects
Dim subjArray
Dim iLoop

subjects = Request.Form("subjects")
subjArray = split(subjects)

strSQL = "SELECT firstName, lastName, address1, address2, city, state, pcode, country, email FROM"
For iLoop = LBound(subjArray) to UBound(subjArray)
subjArray(iLoop)

View Replies View Related

Insert Multiple Values

I've a multiple checkboxes and would like to insert those values into the db. How can we insert all those checkboxes’ values into 1 field (DB), we use a stored procedure. This is urgent

View Replies View Related

Multiple Insert Record

i want to insert some records to Access Database using the checkbox.i've try all the example i've found but it does't work.it's like checking our yahoomail.but i want all the tick checkbox insert to database

View Replies View Related

Insert Multiple Records

I have a recordset that contains multiple records of product a user is purchasing. For clarity, I converted the recordset fields to variables. I need to take that entire recordset and insert it into another table on a remote server. The below code only inserts 1 record. How do I change the code to get all records inserted?

<%
Dim DataConn2
Set DataConn2 = Server.CreateObject("ADODB.Connection")
DataConn2.Open MM_kasKSS_STRING
SQL = "INSERT INTO wsOrderDetails (OrderID, OrderNo, Description, Qty,
PriceEach, Priceline) "
SQL = SQL & "Values ('" & iod_OrderID & "', '" & iod_OrderNo & "', '" &
iod_Description & "', " & iod_Qty & ", " & iod_PriceEach & ", " &
iod_Priceline & ")"
DataConn2.Execute(SQL)
%>

View Replies View Related

Multiple Insert In SQL Statement

i have a problem while running an insert query into SQL using ASP. sometimes the query inserts the values twice.

View Replies View Related

Insert Multiple Rows

I use Access Data Base 2000 and ASP configuration. My case is that I constructed a Editable Grid with 5 columnar labels so that I derive many rows from database for the client to choose from by the help of check boxes that I externally added for each row. What I have to do is after client chooses the rows by clicking the check boxes and then clicking on the submit button.

I would like to insert the marked rows with labels(4 or 5 labels)into a differant database table from the one where the data was first drived. BTW, within the editable grid I have 4 submit buttons and each button should insert checked rows into differant data base tables.

View Replies View Related

Insert Into Multiple Tables

I need help inserting the same inormation in second table called "users"

' insert to customers table with retail type by default (admin can change to BtoB later with BackOffice)
mySQL="INSERT INTO customers (name, lastName, customerCompany, email, city, countryCode, phone, address, zip, password, state, stateCode, idCustomerType, active, user1, user2, user3, bonusPoints, idStore) VALUES ('" &pcustomerName& "','" &pLastName& "','" &pCustomerCompany& "','" &pemail& "','" &pcity& "', '" &pCountryCode& "','" &pPhone& "','" &pAddress& "','" &pZip& "','" &pPassword& "','" &pState& "','" &pStateCode& "',1," & pActive & ",'" &pUser1& "','" &pUser2& "','" &pUser3& "',0,"&pIdStore&")"

call updateDatabase(mySQL, rsTemp, "customerRegistrationExec")

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

Multiple/Mass Insert

my page(searchresults.asp) will show all the results that you searched for.. These results are from the sql server. All the datas are different. On the right of every record, there is a checkbox.

Now is the scenario..

After all records are shown, I will check a few checkboxes. Then i will click the button. All the data that is checked will be inserted in the sql server. But the thing is that all data records is different..

Its actually kinda off like the hotmail, where you checked a few boxes and put them into a different folder..

View Replies View Related

Multiple Record Insert

I am trying to insert multiple records into Access DB from a form. Code:

View Replies View Related

Multiple Insert With Checkbox...

This is my problem... its for a mailing list with categories...

I have 3 table...

1 : Name,City,Email

2 : Categorie

3 : Name_id , Categorie_id

So when a user fill up the mailing list form, he can check as many categorie he want...

but how i can insert 1 row in my table #3 for each checkbox checked...

Can someone post me a simple script...

View Replies View Related

How To Insert Multiple Records In Database?

how to insert multiple records in database?? i have this problem like i have this one form and there are three fields like the (quantity,unit,item name)..the item that will be inputted will vary, depending on the number of item to be inputted..

Ex.
enter the number of item: 3
qty unit item_name
1. 2 pcs pencil
2. 2 pcs glue stick
3. 2 pcs clip
(SUMBIT)

what should i do in order that these items will be inserted in just one insert statement?

View Replies View Related

How Do You Insert Multiple Records At The Same Time?

I need help to solve this situation....

House 1 (1 photo)
House 2 (4 photos)

Example:
Table1
idHouse....#auto
House.......text
Addr..........Memo

Table2
idPhoto.....#auto
idHouse....num
Photo........text

I need insert multiple records into a single field of the Table2 and
insert the idHouse too. How do I do this?

View Replies View Related

(Multiple) Insert If Data Is Not Empty

I have 6 textboxes where user can input data (or can leave it blank). I need to insert all the data (if not blank) into the database. How should be SQL query be like? ...

View Replies View Related

Multiple Insert Into Access Database

I need to insert into an access table multiple times i know how to insert 1 item but not multiple times.

View Replies View Related

Insert Multiple Records Into The One Table At The Same Time

Does anyone know how to insert multiple records in the same table at the same time. This is what I have. I have a form with 6 fields and they are name prod1 through to prod 6. The table is called related products.

Basically this table is related to the main table called prod_parent. tried looking on google and couldn't find anything.

View Replies View Related

Split String To Perform Multiple Insert

I have the belwo code which i mean to do an multiple checkbox insert. I have managed to get it so i puts all the checkbox values into a string seperated by a comma, and it insert into a database, however just not how i need it to.

Curently inserst like :-

View Replies View Related

Insert Multiple Selection From Listbox To Database

after a lot of searches to see if i can get such a code on the net, i've finally come to ask my questions here bcoz i can see bits of code here n there on net but not what i really want.

i have a form with a listbox(lstduty) on it. i have been able to populate it with data(dutyName)from table 'duty' from a sql server 2000 database.

now when a user makes multiple selection and click the 'add' button, i want to be able to add it to another table in the database as below: Code:

View Replies View Related

INSERT Multiple Records From Checkbox Form With Unique Ids

I have an .asp page with a form to copy job responsibilites form one
job to another. It is a hotmail type interface with checkboxes
besides each responsibility. After submitting, it should copy the
selected resp's to a different job. After that it should renumber
that job's responsibilities.

This is the code I am using now to copy:

copySQL4 = "INSERT INTO
jambue.RESP(POSCODE,IDCODE1,IDCODE2,RESP_NUM,RESP) SELECT '" & id & "'
POSCODE,'" & dept & "' IDCODE1,'" & unit & "' IDCODE2, '999' RESP_NUM,
RESP FROM jambue.RESP WHERE (POSCODE = '" & POSCODE & "' AND IDCODE1 =
'" & sourceDept & "' AND IDCODE2 = '" & sourceUnit & "') AND RESP_NUM
IN (" & Request.Form("chk") & ")"

As you can see the value '999' is hardcoded in there as the new
Responsibility Number to go with the copied responsibility. I use
this because there are no jobs with that many responsibilities. This
works fine if I only select one resp. to copy over. But if I select
more than one that part still runs fine but I get an error with the
below. It says too many rows would be affected. Of course, this must
be because there are now at least 2 responsibilites with the same
RESP_NUM. Code:

View Replies View Related

Trying To Insert Multiple Records Into Database When Form Is Submitted

I'm trying to insert mutiple records into my database when the form is submitted.. My form has 4 textfields; serial1, price1, serial2 and price2.

I would like to insert serial1 and price1 as one record, then serial2 and price2 as the second record. I know some sort of loop has to be used to achieve this but i'm new to this and I don't know what to do...

I tried to do it with dreamweaver but it does not seem possible and the dreamweaver code seems really complicated I've only been able to insert only the first row(serial1,price1).. since I only have 2 fixed rows I guess what I need to do is to get dreamweaver to do it twice in a loop. Code:

View Replies View Related

Submit Form Elements To Insert Multiple Records Into A Database

I have a table that contains all of the function permissions within a given application. These functions are different sections of a site and each has its own permissions (READ, WRITE, UPDATE, DELETE) which are controlled by a web frontend and the table
records are manipulated to control the permissions. Code:

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

Searching Multiple Memo Fields In Multiple Tables In Access

I have a search option on my website, which should perform a search on 4 fields, as follows:

tblNews
headline
content

tblDatabank
filename
description

It only needs to return matches which are an exact match of their search criteria. For instance, searching for "I am here" would return a record which contained "I am here", but not just "I" or "I am" etc.

I need to return all these records as part of one recordset preferably, as I want to be able to order them etc., though I imagine you may suggest I use an array somehow to merge two recordets etc., then reorder them?

View Replies View Related

How To Update Multiple Records With Different Multiple Value

i hav problem with updating the data. In the asp page i hav displayed records based on search criteria. in display mode im displaying the to be updated field in combo box for each similar contract_no. each contract_no will hav different no of rows and to be updated combo box.

based on the selected value in the combo boxes of different contract_nos i hav to update the combo value with old value. user select multiple combo values at a time I need anybody's help with detailed programming logic.

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

Insert In SQL ASP

i have got a data base which contain more than one tables
one for student one for teacher and one for books

i make a fourm to read the input from the user Code:

View Replies View Related

Insert All At Once

Code:
mySQL="INSERT INTO products (sku, youtube, description, details) VALUES ('" &pSku& "','" &pYoutube& "','" &pDescription& "','" & pDetails& "')"
call updateDatabase(mySQL, rstemp, "insert1")

that's shortly the way i'm inserting new records.
using mysql and asp functions.

The prob is that inserting only one record every time.
if i got data for 3 records how can i make it at once
to add 3 new records in some given order into the db

View Replies View Related

ADO Insert

What is the best way to see if a record has inserted correctly into the datase in ASP?
Also, how to tell the user what the error is.
I am inserting like this with the ADO command object:
Dim sInsert, objCmd
set objCmd = Server.CreateObject("ADODB.Command")
sInsert = "sp_ADS_Insert_Driver_General_Data "
on error resume next
With objCmd
.ActiveConnection = oConnEnergy
.CommandText = sInsert
.CommandType = adCmdStoredProc
.Execute , , adExecuteNoRecords

View Replies View Related







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