Adding Records To Multiple Tables
i have an instance where I need to add records to 2 different tables. i know how to do it basically, but the problem is, one table is generating a key number and i need this number for the second table records.
how do i put the appropriate records into the first table, grab the id number and insert the records into the second number? the information is coming from a form. i'm developing in an access db but will be moving this to an ms sql db before it goes live.is there a stored procedure that might make this easier? i know nothing about stored procedures.
View Replies
ADVERTISEMENT
I have a form that uses Code:
<select name=player_id multiple>
<option player_id="<%=player_id%>"><%=FName%> <%=LName%></option>
</select>
To create a drop down selection list. What I want to send to a table is FName and LName instead of the ID. Any hints on how to do this.
View Replies
View Related
SQL 2000 database with ASP
I've found many things "out there" regarding updating and deleting
multiple records with checkboxes but I can't seem to find anything
about adding them. A user wants to create a price list for their
client and they need to add parts to it in a separate table. I would
like to display the list of parts and the user would select multiple
parts to add to a price list by checking a checkbox and submitting the
form. Code:
View Replies
View Related
how do you do this. 2 tables. one called "Bookings" one called "Rooms"
what kinda query would i use to make it LIST the contents of the ROOM column in the BOOKINGS table, then get remove identical matches in the ROOM column in the ROOMS table?
View Replies
View Related
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
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
is it possible to dynamically add a field into a table? or add a table? Lets just say that I have a DB with 10,000 entries and about 5MB in size. I want to add a new feature and for this i need to add an extra field to the table. I don't want to d/l the DB, make the changes locally and then u/l again, so can I do it via script?
View Replies
View Related
i have 2 tables;
table01:
fields are
field01,field02,field03,field04,field05
and another table
table02:
fields are
field01,field02
when someone submits the form, i want to add the infos supplied by the user to be added to these 2 tables.
field01 & field02 shall be added to tables 1 & 2;
&
field03,field04 & field05 to table01 only
i tried using this code:
myquery = "INSERT INTO table01 (field01,field02,field03,field04,field05) VALUES ('" & f1 & "','" & f2 & "','" & f3 & "','" & f4 & "','" & f5 & "')"
myquery2 = "INSERT INTO table02 (field01,field02) VALUES ('" & f1 & "','" & f2 & "')"
adocon.execute myquery,myquery2
but this one only adds to the first table.
can someone tell me how to fix the problem?
View Replies
View Related
i run a classified ads site that allows people to post ads, and stores the results in a ms access database.
2 of the imput fields are: price and quantity
What i am trying to do is the following:
To add all the prices and and quantities together and be able to display the results on my site for example my database has the following:
Price | Quantity
2.00 | 300
1,50 | 1
10.00 | 10
140,00 | 7
and on the website i can display the results like so:
Current ads worth: 1681.50
I need the script to ignore letters as in the quantity field people have also added word such as packs and VE ETC so i need it to ignore letters, however in the price field some people have placed the ( , ) sign in there price so the code must recognize ( , and . )
View Replies
View Related
if the order of the fields in a query matters when querying a table with asp. that is, if the table has columns labeled "RecordID, FirstName, Initial, LastName, etc" in that order, do i have to do my "INSERT INTO" command with the fields in that same order, or could i do "FirstName, RecordID, LastName, Initial, etc" ? i think it doesnt matter. am i right?
View Replies
View Related
I have a table with 2 fields, name and value
I need to be able to add multiple records quickly, for example I need to add
name value
abc 1
abc 2
abc 3
abc 4
abc 5
abc 6
etc etc, does each record have to be added separately, or is there a way I
can add a chosen number of records, lets say 10, and have the value field
increase by one each time?
sometimes I might have 30+ simple records that need adding quickly, and each
time the first records value will be one, and each record after will
increase by one, is there a way to solve this problem or does each record
have to be added separately?
View Replies
View Related
I have a drop down which has numbers from 1 to 25
When a user selects 3 he will see 3 first name textboxes and 3 last name textboxes
the user fills them out and hits the submit button
three records are added to the table
i have a for loop for adding records
Here is my code:
View Replies
View Related
Just when you think something is working, suddenly something new comes along.this is my situation: I want to add intQuantity of all records that have the same prodID. I have tried all sort of variations but I don't seem to get it. I would imagine that it must be simple, that's why I can't get it.
SELECT SUM ( intQuantity) AS ItemTotal
FROM tblOrders
WHERE prodID = ? no clue
Or can I do that in ASP? doing something like (my example doen't work)
<%= (rsOrders("intQuantity") + rsOrders("intQuantity")) %>
in the mean time I'll be looking around for an answer to my lack of know how.
View Replies
View Related
I have loop displaying certain records depending on an id number in my sql database. What i need to do using asp is total all the numbers in one of the fields and display that as a response.write.
View Replies
View Related
I may have made a typo somewhere. I am trying to delete collections from RelProdCollection Table that has a certain record with Product ID number of __ and then readd them based on the user's choices on the edit form. Code:
View Replies
View Related
I want to add intQuantity of all records that have the same prodID. I have tried all sort of variations but I don't seem to get it. I would imagine that it must be simple, that's why I can't get it.
SELECT SUM ( intQuantity) AS ItemTotal
FROM tblOrders
WHERE prodID = ? no clue
Or can I do that in ASP? doing something like (my example doen't work)
<%= (rsOrders("intQuantity") + rsOrders("intQuantity")) %>
in the mean time I'll be looking around for an answer to my lack of know how.
View Replies
View Related
I'm trying to put my data from Access DB into a table, but, where I know how to do it creating one row per record, what I'm wanting to do is essentially extract each record into 1 cell, and then have the next record in the next cell, creating a table 2xn in size.
The data I'm getting for each record is a URL & a file location, to create an image hyperlink for each record, and need the images to appear in a table 2 columns x however many rows required.
View Replies
View Related
I have a data base that I wish to add a record to. I have many fields to ender, but I was testing my code with just one and it works just fine : Code:
View Replies
View Related
I'm writing a database admin page in ASP. I had it adding records correctly. Then I added an autonumber field ("ID") to the table, and it stopped working. The sql I'm using is Code:
View Replies
View Related
There is something wrong with the adding code. It will add sometimes. It's a large database where I have to add records to multiple tables.
The products table doesn't work correctly. Maybe there's a typo somewhere that I don't notice. Please look at the bolded part of my code and see if you can catch something. Code:
View Replies
View Related
Can I do the following things in the global.asa file?
When sessions starts:
Add a record into my database
When session ends:
delete it where rs("sessionid") = Session.SessionID...
?
I'm pretty sure I can, but...I've heard not ALL things can be done in global.asa...
Do I create an object, and a connection? How would I do it? Since I want a database in MY database, not in memory like I've seen...
View Replies
View Related
Okay, I have a db that contains 1 table. it has some house info and stuff in it, but I want the updates and news and stuff on my site to be dynamic.
So should I make a new table inside my DB and use that alongside the house info table? What would be the best way to accomplish this, and if possible, do u have to set a recordset up for EACH table?
View Replies
View Related
how do i add afew items into a database of only a field name?
for example if there is only item_1.. it will add item_1 only. but if there is item_1 & item_2. how do i add them to the database name ("Items No")?
View Replies
View Related
I have never programmed in ASP in fact I am not a programmer at all. I found this script that sends an email that pulls information from a contact form.
'Sends an email
Dim mail
Set mail = Server.CreateObject("CDO.Message")
mail.To = "youremail@yahoo.com"
mail.From = Request.Form("your_email")
mail.Subject = "Contacts"
mail.TextBody = Request.Form("your_message")
mail.Send()
Response.Write("Thank you for visiting!")
Destroy the mail object!
Set mail = nothing
I got it to work with my flash contact form however on the form I have two other fields. Name and Phone number that I want to tack onto the TextBody but I do not know how to do this.
View Replies
View Related
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
I got an asp page that supposed to add,delete records from access 2000 mdb file. It loads all the records but when i try to delete or update i get these errrors. Code:
View Replies
View Related
i have 3 tables how can i join these three tables using id_num primary key.
View Replies
View Related
I want to query multiple tables (all with exactly the same field names) and then display the records returned in date order.
I've written the SQL to query all the tables (they start with the same name, but end with sequential numbers), but it's returning no records when I know there should be some. Any ideas? Code:
View Replies
View Related
i have a simple search page which i want to search mutiple tables with different layouts so i can return the search results in one recordset. how owuld i do this?
View Replies
View Related
I have 3 tables
Employees,
nationalities,
Companies.
I can easily use a join to retrieve all the data I need from all three tables.Now my problem is updating those tables.I want to be able to update all three tables in one swoop. That is, how do I update all three tables with one update statement? Is this even possible?
View Replies
View Related
I am trying to create a datalist that pulls from table A. When the user clicks on one of the rows in table A I want it to expand under that row and show the data from table B (one to many relationship).
Im not sure what is the best way to accomplish this. Is there a way to use the selecteditemindex to insert a new datalist ?
View Replies
View Related
anyone in here got an idea on how to open multiple tables on a single asp page? what i did was put 2 record sets but the problem is only the first table was looping.
View Replies
View Related
I havecracking my head to solve this problem. I am doing a project on Online form. But because the there is too much field for a table, i have to split it up into 3 tables. I need to know how to update the 3 tables simultaneously, when i submit the form.
View Replies
View Related