ASP Application Form To Insert Records Into SQL Database
I have a project where i have to use an html asp application form to insert records into an sql database. My problem is finding resources online to practice with to learn, i have basic knowledge of ASP and have attended the microsoft 1 week course on Administering a 2000 SQL Database and i have designed a few small sites so i know html and javascript. I have the database side covered its just the VB code to take the form values and post them to the sql database.
I was wondering if anyone could point me in the right direction of sample codes to play around with as i cant seem to find any which relate to this project.
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
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
Can't Insert Records In My Database..
I am workin on a project at home,asp vbscript website, n im having problems with inserting records into my database .. I am using a dsn-less ADODB connection, but it seems that some kind of security is preventing me from writing in the db.. i can access n retrieve, but NOT WRITE.. ive tried disabling every type of security, still doesnt work..
View Replies !
View Related
Insert Records Into Database
i have learned database connectivity. I am facing some problems in inserting records to database using SQL. Please tell me the way to insert records using SQL. I received error about wrong arguments on following line. Rs.Open Query, DBConn, adOpenStatic, adLockOptimistic where Rs is the RecordSet object, Query contains they SQL String, and DBConn is the Connection to my Microsoft Access database. I easily connected to the database and retrieved records using following command: Rs.Open Query, DBConn, 3
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
Can't Insert Records From Page With Request.form
I'm trying to insert records into an SQL database coming from a page using the request ..form method. The table "general" has a primary key 'geid .' I get the following error: Cannot insert the value NULL into column 'geid', table 'general'; column does not allow nulls. INSERT fails. ....not sure how to include the 'geid' field into the scheme. strSql = "insert into general (firstname,surname,company) values ('" strSql = StrSql & Request.Form("firstname") & "', '" strSql = StrSql & Request.Form("surname") & "', '" strSql = StrSql & Request.Form("company") & "')" myconn.Execute (StrSql) ....
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
Syntax On Passing Variables From Email Form To Insert A Database...
I'm having a problem with passing variables inserting to my database. Here's what I'm doing. I have a page where the user selects a team member (this is fine) Once the team member is selected I have the variables on the form send and email to all supervisors and the member selected (this is fine also) BUT, I'm having problems inserting the emailed information to my access 2000 database after is email. Can someone guide me in the right direction.
View Replies !
View Related
Pulling Records From End Of A Database Or Inserting New Records To The Beginning
I'm trying to pull the last 5 records from my database. <% j=5 rs.MoveLast While ((j>0) AND (NOT rs_article.BOF))%> ''Execute HTML and data insertion here <%rs_article.MovePrevious j=j-1 Wend%> Everytime I attempt to run this code, I recieve an HTTP 500- Internal Server Error. It tells me no more than that. I know that my connection settings are OK because when I move forward through the database (first five records), the code executes without error. And yes, my Cursor type is Dynamic. Alternatively, I would also like to know how to add new recordset to the beginning of a database rather than the end.
View Replies !
View Related
Insert All Records
I am trying to figure out a way to insert all the records from a dynamic table - repeat region into one table as individual records. On the 1st page users select which items they want from a large list. When they click submit it passes the values ( IDs ) with a URL par to the next form. This form has a recordset that uses the URL par from the last page and creates a new dynamic table - repeat regon with all the records they chose. I need to do this so I can then add up rates for those selected items. I need to find a way to the add all those selected records now into one table. Also I need to have them insert each record at a time. So if 4 records are in the recordset and repeat region, I need to have it add 4 records into the table. Hope that makes since. Im a bit lost on this one.
View Replies !
View Related
Insert Records
Is it possible when you insert a record in a database to only insert max 5 records. Can i make it delete the oldest one when i want to insert record #6 and so on?
View Replies !
View Related
Insert Records Access DB
Anyone know if it is possible to update/insert a database record into a dynamically specified field. The code I have here holds data in an asp session, ownerId, storeid and product type. I can insert a record into the Productcat table, fields OwnerId and surfboards, no problem. But what I would like is to insert the ownerid then insert poduct type into the field sepcified in the session variable (session("prodtype")) and/or strprodtpye For Example Insert OwnerId + product type into productcat into fileds ownerId and field labled ''strprodtype'' (variable, surfboard, wetsuit, boots, etc) SQLstatement = "INSERT INTO Productcat (Ownerid,'"&strprodtype&"') " I have tried using different methods, but the closest I got was IIS error msg ='field not found ("Surfboards", "wetsuits", "boots", etc)' Code:
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 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
Unable To Insert Records
I get this following error while inserting recoed in ms-acces db : Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only. /mis/add_iteminfo.asp, line 35 This thing is making me go crazy as i'm running windows platform & running the app on localhost. The have several times but the db isn't read-only, not even in the iis. Don't know what to do .
View Replies !
View Related
Insert Mltiple Records
What is the most efficient way of inserting multiple records into a database ? At the moment, I'm grabbing data and inserting each record with a loop. The only thing is on each loop I'm opening a connection to the db (SQL Server), inserting a record, then closing it. Is there a way of inserting all the data with either one command or by keeping the connection and looping the command instead. The situation is the user entering email addresses into a textarea, one per line, then process each of those emails as a record.
View Replies !
View Related
Web Database Application
I'm wanting to create a simple web database application using MS Access, but i'm not sure where to start. All i want is the database to hold names of students and information about them as well as the courses they are studying. Then i want this information to displayed on a web browser. Do i need middle tier software? If so what would you suggest? I've tried running apache tomcat but it won't start for me. Or does anyone know a good tutorial using MS Access and ASP?
View Replies !
View Related
Insert Form
I am geting this message when INSERTING a form. Microsoft JET Database Engineerror '80004005' Operation must use an updateable query. /admin_pportfolio_bl_insert_processor.asp, line 8 the code on "admin_pportfolio_bl_insert_processor.asp" is Code:
View Replies !
View Related
Insert Form Fields
I have about 30 names of workers (and their IDs in hidden fields, that depend on their departments) in one form, beside them there is one dropdown list for each worker, with same items. I want to select item from dropdown list for each worker, that will write item ID in another hidden field... and then I want to submit worker's ID, ID from dropdown list etc....into another .asp page and sql db. If I use next way : <% FOR EACH name IN Request.Form Response.Write("<BR>") Response.Write(Request.Form(name)) NEXT %> I get only values of IDs from dropdown lists. But I need workers' IDs, too.
View Replies !
View Related
Using A Form To Insert Into A Table
I am trying to make a page post.asp with a form that simply submits one text value and two hidden values into a table. I already have the function that takes the 3 parameters, modifies them and successfully inserts them into the table: I have included this function in this post.asp page ...
View Replies !
View Related
SQL Insert Syntax W/ Form
I can't seem to get this page to work. Its a basic form (with a lot of fields) and I need to insert part of the data into one table and part into another. Here is what is at the top before the <html> tripreportR.asp Code: set The form's action is to post to itself. I can't get the data in and I can't even get the page to show now. Any suggestions, ideas, links, resources would be great!
View Replies !
View Related
Db Insert And Form Email
I have a form that performs a db insert (through a Dreamweaver server behavior) . After the insert, the page is redirected to a page where the form information should be mailed to a specific email address - request.form("dlEmail") Is it so, that when I do an Insert statement, the request.form - variables get erased or so? I don't manage to get the email working. It inserts the info ok, but when coming to the sendmail.asp page, I try to refernence the different form fields, and they all appear empty.
View Replies !
View Related
How To Insert An Image In The Database...
I m trying to set up a form so that a user can isert a gif or jpeg image into a table in the database. 1) Can you please show me how to create a table in the database so that it accepts the images 2) I need to know how to actually browse to an image in hard drive and then insert it in the table
View Replies !
View Related
Insert Problem Into Database
i have an excel file from where i want to move every record into a database the insert is working but..... after the insert the first record of the excel file is getting inserted at 168 th place in the table the first six rows in the table are have no entries after insert the 18th row of excel file is the 7th record in the table after insert why is this happenin the insert statement is as below: objConn.Execute("INSERT INTO A VALUES ('" & excelrs("Description") &_ "','" & excelrs("MachineNumber") & "','" & excelrs("Category") &_ "','" & excelrs("ProductTested") & "','" & excelrs("Program") &_ "','" & excelrs("ComponentPartNo") & "','" & excelrs("Qty") &_ "','" & excelrs("OldPartNo") & "','" & excelrs("NewPartNo") &_ "','" & excelrs("Status") & "','" & excelrs("Location") &_ "','" & excelrs("FixtureRequestID") & "')") i used response.write and the records are getting displayed properly from the excel file
View Replies !
View Related
Insert Image From Database
I AM NOT ABLE TO DISPLAY IMAGES FROM ACCESS DATABASE JUST 11 BLACK IMAGE BOXES OF SIZE 400 X 250 Code: sql="SELECT [IMAGES] FROM ITEMS" rsAuthors.open sql, cnnNorthWind, 3, 3 %> <%Set rsAuthors = cnnNorthWind.Execute(sql) IF rsAuthors.EOF then 'No records found Response.End ELSE 'Display the contents DO WHILE NOT rsAuthors.EOF 'Response.BinaryWrite(rsAuthors("IMAGES")) %> <img src="image/<%=rsAuthors("IMAGES")%>" height="400" width="250"> <%rsAuthors.MOVENEXT LOOP END IF %>
View Replies !
View Related
SQL INSERT To Access Database
Trying to insert the following information (collected from a form) into an access database. "INSERT INTO Products (Make, Model, Description, Features, EduPrice, ComPrice, OffPrice, IsOffer, Picture) VALUES ('" & strMake & "', '" & strModel & "', '" & strDescription & "', '" & strFeatures & "', '" & strEduPrice & "', '" & strComPrice & "', '" & strOffPrice & "', " & strIsOffer & ", ' & strPicture & ')" keep getting a sytan error though! "Syntax error in INSERT INTO statement."
View Replies !
View Related
Pass Hidden Form Field Value To Another Form Field To Insert In Db
I am trying to pass a hidden field value on a form into another field on the form so that it can then be inserted in the database, to enable me then to reference that number at a later date. (The hidden value (1 for example) would then automatically get passed to the other input field.) The code for the text field that allows users to type an number into it for submission to the db is below, but what code do i need within the hidden field to populate this text field below so that users do not have to type the number in? Code:
View Replies !
View Related
Using Database Records To Log On
Does anyone know if it's possible to use the records stored in an Access 2002 database to log users into an ASP.net page? I'm trying to code it in vb.net but im not sure how it could be done. Basically I think I need 2 text boxes on the ASP page where the user can enter their name and password. I then somehow need to retrieve the name and password from fields in the database (using ADO.net i think) and compare them with those entered by the user. If they match then I want to load another page, and if not then I want to display a message saying login details are incorrect. Any help on this subject would be much appreciated- the fields i have at the moment are called 'User' and 'Password' in a table called PERSON.
View Replies !
View Related
Records To Database
I need to insert many records from one table of one db to another table in another db. I have done this, but I have a problem in the case that if an IDNumber is unique in the destination table. How can I, In the case that record (IDNumber) already exists, to skip that record and continue normally with the rest of records. Not to update that record but to skip that record.
View Replies !
View Related
Insert Occuring In Middle Of Database
I have a couple pages that submits a form to an oracle database however and then I display a case number after the form is submitted. However, the records are not always being inserted at the end of the database. For example if I look at the case numbers in the database they are in this order: Code:
View Replies !
View Related
|