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 Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Insert In DB
I have a form which the user fills and submits.i have insert statement there. When i submit the form to itself ,the values get submitted and inserted in DB easily. <form method="post" action="Infoviewagentver212.asp" name="form"> Now when i want the user to hit submit and go to other page i change the above to: <form method="post" action="newpage.asp" name="form"> but here what happens is my values are not getting inserted in the DB?? How do i do this?
INSERT INTO
I'm using ASP + MS SQL. I wrote a simple insert into command but nothing is happening... it gave no error and no information is stored in the db. When I response.write my SQL, I got the following: Code: INSERT INTO [blog_entries](title,user,entry,date) VALUES('test','admin','test','Tuesday, December 25, 2007')
Insert Into
I am very new at this and ding this in context of a course. I am getting an error stating Error Type: Microsoft VBScript compilation (0x800A03EE) Expected ')' Can you please look at this and tell me where I went wrong ? Code:
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?
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:
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
DB Insert
Application X has three screens. The user captures information on screen one and then clicks a navigation button to go onto screen two.He does the same on screen three. At the bottom of screen three is a submit button. When this button is clicked the system does some calculations with the information that is supplied and then uploads all the info that was captured on the screens to the database. Should the data be uploaded to the database all on one go when the user clicks the submit button or should it be uploaded after each screen - ie when the user clicks the button on Screen 1 the data is uploaded to the database and then screen two is displayed.
INSERT INTO
I have a database in which I have to on a daily basis enter the information for that day.I would like to update this on a bi-hourly basis to prevent any possible data loss. Using INSERT INTO, I create a new table line. Using UPDATE, I get an error on the inital creation of the table line.I am really unsure how to check to see if that line exists or if there is an easier way around this.
SQL Insert Into
When the following code runs it produces no errors but doesn't give proper results: sql = "INSERT INTO TableName (Line1, Line2, Line3, Line4) VALUES ('" & lines(0) & "', '" & lines(1) & "', '" & lines(2) & "', '" & lines(3) & "')" Response.Write(sql) SET RS = Conn.Execute(sql) lines() contains nothing but strings and is never empty. The Response.Write(sql) shows the proper values going into the proper locations. However, only Lines(0) actually populates the table. Line2, Line3, and Line4 never receive any values despite the SQL showing the proper syntax.
Insert
i have this insert statement that is giving me trouble, the problem is with expiration_date field the error i'm getting is: Syntax error in date in query expression '##'.Code: SQL_Insert = "Insert INTO TableName(ColumnX, ColumnY, ColumnZ, ColumnZZ, ColumnXX, ColunmYY, Expiration_Date) values ('" & _ ColumnX& "', '" & ColumnY & "', '" & ColumnZ & "', '" & ColumnZZ & "', '" & ColumnXX& "', '" & ColunmYY & "', #" & Expiration_Date & "#)"
SQL Insert
I'm using a list in a form in which users can select up to three items. When they submit the form, they are of course being inserted into one field as comma delimited. I can split the data to display, but I was wondering if that data could be inserted to the table as its own record. So, instead of being inserted as one record with three comma delimited choices, I would like three records with one choice in each. Here is a sample of my code: conn.execute=("INSERT INTO Submitted_Information (PreferredGrade, PreferredSubject, Sponsor) Values (" &_ "'" & PreferredGrade + "', " &_ "'" & PreferredSubject + "', " &_ "'" & Sponsor + "')" ) conn.close %> Preferred Grade and Preferred subject can have up to three selections each.
Odd Insert Into MS SQL
I have a column call UserDate and it's properties are this : varchar(50) . I have a function which updates the column with todays date. for some reason, if I manualy give the value to be inserted a value of '10/10/2006' or use date() it inserts a value of 0 if I give a value of 4 to be inserted it works? I have been working on a project for 2 days and this is the last piece to get it to work, can anyone point out where I'm going wrong. P.S I have tried giving the colum a date format but unfotunately the format is american and I need it in english to compare with something else I'm working on.
Insert Into
how do I insert file.filename into the access database when i upload a file it saves to uploads folder see code that doesn't work below file.SaveAs("/johnny/Uploads/" insert into pics1 set rspic = '" & file.filename& "' where author = '" & session("variable") & "'")
SQL INSERT
I have some data I want to put into the database. My question is twofold. What is the best/most efficient way to do this? I've heard of the Execute method, but I can't seem to get it to work. Why won't it let me close the recordset object when I insert a record? Code: [vbs] sqlTxt = "INSERT INTO tablename VALUES ('ShopperID', '" & Date &"', '"& Cust_Name &"', '"& Cust_Password &"')" set rs = server.CreateObject("adodb.recordset") rs.Open sqlTxt,conn [/vbs] Whenever I use rs.Close, it tells me that the operation cant continue while the recordset is closed.
SQL Insert
I am getting syntax errors when trying to insert my form. This is what I am doing: INSERTSQL="INSERT INTO EPR_PTS_ISSUE_TRACKING (Issue_Type, Request, Issue_Title, Issue_Desc, Application, Status, Created_By, Date_Entered) " INSERTSQL=INSERTSQL & "VALUES (" INSERTSQL=INSERTSQL & "'" & Issue_Type & "', " INSERTSQL=INSERTSQL & "'" & RequestNum & "', " INSERTSQL=INSERTSQL & "'" & Issue_Title & "', " INSERTSQL=INSERTSQL & "'" & Issue_Desc & "', " INSERTSQL=INSERTSQL & "'" & txtApplication & "', " INSERTSQL=INSERTSQL & "1, " - The error is between this line INSERTSQL=INSERTSQL & "'" & Created_By & "', " - and this line. INSERTSQL=INSERTSQL & "sysdate,"') " set rs=cn.execute(INSERTSQL)
Get Last Insert?
How can i get the last inserted record in an ASP ACCESS combination? Code:
Insert Problem
I have a 2 asp pages for a registration form. The first one is where the user types the data, and the second one has a form that requests the data from the 1st one and then sends it to the database. Both are sending the data correctly (I've seen it on the error page) but it's not feeding the DB.
Insert Problem
Microsoft OLE DB Provider for SQL Server (0x80040E2F) Cannot insert the value NULL into column 'ContactID', table 'ka0506a.ka0506a.contacts'; column does not allow nulls. INSERT fails. /submitcontact.asp, line 15 What happened is i used to used MS Access and ContactID is an Autonmuber field, and now my connection is set to MS SQL so it's giving me this error, what's causing this error to happen and how can i change it ?
Insert An Image
I have a website I am working on that I did not create. It is ASP and SQL based. There is a content management system created using ASP and saving in the SQL server database. A user can enter a news article into a big text box/area, and choose to add an image. The text and image are stored in the database via ASP and pulled out to the website via ASP. The image shows up in the website to the top left of the article. I need to make it so the user can enter an image where their cursor is in the paragraph (like a word document) and have it also show up there on the website. Any ideas?
Insert ASP Code In JS
I have a problem. I have ASP code and Javascript code. Now, I want to access ASP code inside javascript code. Here is the ASP code:
INSERT INTO Problem
This is on my HTML page <td align=center> <textarea cols="85" rows="7" name=""Problem"></textarea> </td> User" enters information into this box. If they use either a quote or double quote, but SQL statement bombs. Is there a way quick way to fix this beforehand? Conn.execute ("INSERT INTO PROBLEMS (Problem) VALUES ('" & Problem & "')")
ASP Insert Process
Just like to know if I am correct and no problems in this scenario: I have page where the user clicks a button to save some information >> gets directed to page 2 where a value gets returned from a recordset and the form is inserted automatically upon loading with the value (sequential for the database table) >> the user then gets redirected to page 3 upon insertion into the database, if I use 'Select Top 1 ......' as a query to retrieve some information on this page am I sure that this is the correct record just inserted even if 2 or more people are saving at the same time?
Insert Statement
I have an asp page which runs an update into our mysql database. The only problem I have is that a user selects a customer from a dropdown (this is database fed), and I require the selected item to be loaded into the db. All I can get in the database is the first part of their name upto the first space ? i.e. if the selected item from the dropdown is A B Knowles, the database entry is 'A' cust = request.form("customername") I have tried adding ' " & cust & " ' for the insert statement What do I need to do to fix this minor glitch.
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:
Insert Data In My Db
I've been choosing to insert data ni my db using a recordset with methods AddNew and Update. I would like some advices to make my coding opractice better. For example: am I doing it right? Is there a better to do what I'm doing and so on...: Code: set rsExample = Server.CreateObject("ADODB.RecordSet") rsExample.Open "example", MyConn, adOpenStatic, adLockOptimistic, adCmdTable rsExample.AddNew rsExample("id")=id rsExample("firstName") = firstName rsExample("lastName") = firstName rsExample("subject") = subject rsExample("message") = message rsExample("new") = 1 rsExample("date") = now
Insert Into All Fields
is there a way to write a insert statment with out typing out all of my field names? i want to do an insert in every field but i don't want to have to write them all out.
Join Insert
How can i insert a data using a join statement insert into partmaster.p, execmaster.e(e.execno, e.model, e.battqty, p.partno, p.parttype, p.itemtype, p.stacklength, p.line, p.execno) values('1234567890', 'GBM', '2', '9876543210', 'AR', 'M', '29V', '2', '1234567890') i have a few input box for the user to enter. but as u can see that both tables has execno. it's for both tables to connect. that's why i want to check on how i can key in one input box insert into execno in two different tables
Insert Date
SQL_query = "insert into Activity_Status(UserID, TotalTime, Score, Activity_Name, Status) Values('" + Request.Form("username") +"'," + Request.Form("time") + "," + Request.Form("QuizScore") + ",'"+ Request.Form("QuizType") + "'," + "'" + Request.Form("status") + "')" How shld I insert a date to this statement?
(ChiliSoft) Insert
Current setup: Sun server running Solaris 9, Apache, Chilisoft ASP, MySQL I'm having problems inserting data into MySQL from an ASP vbscript insert page I am using Dreamweaver to create the forms for ease of use. When I try to insert a record via the table only the first field in the form is inserted into the database and any subsequent fields are ignored I tried creating a test table with just three fields (id (auto_increment), helptitle, helpinfo) The helptitle field is inserted fine and the record is assigned an ID but the subsequent helpinfo field is not inserted at all I then tried creating an insert page using ASP JavaScript and all the fields were correctly inserted
Insert Statement
i tried to insert data's to a table and its working ..but the only problem is when i click the button Submit(to add data)its adding 2 rows of data... 1 is the data's which i entered n the other 1 is a blank row of data...so when i log out n run the form again..error occured.. saying that confilcts in a primary key.. coz there is a blank rows in the table... Code:
Insert Values
Iam trying to insert values into my database, but i keep on getting this error, Code: Subscript out of range: '[number: 1]' I have tried to check my insert values but i can't pickup anything, can anyone assist me in this regard. Here is the portion of the code:
Looping Insert
I'm currently having some major problems with an insert form that I created Basically, if a large amount of information is being inserted into the database I get an error This seems to be a restriction imposed by the host What I would ideally like to be able to do is to grab so many characters from the textarea insert this into the database and loop this until everything has been inserted (the information would all need to be inserted into the same field of a record) I've never tried this before so would appreciate any advice/tips on how to go about doing this
Insert Into - Using Numerics
I have an Access database with Numeric fields. In my ASP code I'm trying to use a variable to enter those numbers, such as Insert into MyTable (Item, N1, N2) Values ('NewThing', v1, v2) I have set v1 and v2 previously with numeric values but they are not recognized. Do I need to wrap v1 and v2 in some sort of identifier, such as "#"?
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:
Insert Statment
Now here is my insert statment and it is giving me this error message: Insert Record 'strSQL2 = "INSERT INTO tblCONTENT_Links (LinkID, ContentOwner_UserGroupID, ContentGrouping, LinkHeaderOrder, LinkDescription, LinkName, LinkURL, LinkHeader, LinkHeaderCategory, LinkRefSite, Active, Archive, UpdatedDate, UpdatedBy, PasswordProtected, CommonLibrary) values ( 141, 7,'public', " & Category & " ,'" & DocumentName & "','" & DocumentTitle & "', '" & Document & "', 0 , 28 , 'www.skyclimber.com', -1 , 0 , #8/27/2004# , 0 , 0, -1)" IE error: Syntax error in INSERT INTO statement.
Too Long To Insert
I want to insert a new row in my db but it says that the "identifier is too long"... ORA-00972: identifier is too long to be more precised... I googled it but I can't seem to pinpoint how to work around this
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.
INSERT INTO - Syntax
ive made the most simple page in the world in ASP, and I cannot for the life of me figure out why this page doesn work. whenever I try, it comes up woth "syntax error in statement".. Code:
Insert Problem
I am trying to insert some records in to a table via an ODBC connection to an older db. Problem is, I cannot insert a record because one of my fields that is required, needs to have 3 blank spaces inserted in it in order for the insert to be successful. However, when I print out my insert statement, the spaces go away, and I am not trimming the field or anything. Just inserting the value as " " Any ideas how I can insert a 3 character string of spaces in to a database?
Sql Insert Error
I'm working on an asp where I wanted to do a simple insert using data from another table, structure is: Table A has columns - ID, Code, Type Table B has columns - key, FName, LNAme, DOB, cd, etc... I need to insert into A, using only the 'key' field from B, rest of the values in A will be hardcoded in (code='XYZ', TYPE='A') I tried this: insert into TableA values (select key from TableB where cd='app', 'XYZ', 'A') but it didn't work, I kept getting an error 'Missing Expression', using Oracle 9i. Also tried speicifying the columns insert into TableA (ID, Code, Type) values (select key from TableB where cd='app', 'XYZ', 'A')
Time Insert
I've got a site with multiple sections (jobs, clubs, motor, property etc), and have banner adverts displaying. Banner adverts have defined start and finish dates to allow advertisers to have period campaigns. They can also choose which section to display in, as well as location of advert (banner, side, base) on page. But I would also like to break it down further for them to have an option of starting at 01/06/2004 06:00pm to 31/06/2004 09:45pm as an example. Firstly, I need to find a time selector to enter the times into 'form field'. any help there? I have a date selector, but no time facility... Secondly, I need to develop the correct select statement. here is the date part of it: strSQL = strSQL & " AND START_DATE >= DATE()" strSQL = strSQL & " AND FINISH_DATE <= DATE()" The problem I know if I simply put the time being greater than and less than, then the advert will only be seen between those times on those days in database, but I need them to be seen between the time on start day to the time on finish time, and all inclusive.
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?
Insert Name Of File
I have a form that uploads a file (i'm using Freeaspupload) and I wish to insert the name of the uploaded file into the database. I'm just a little unsure of what code to use from the upload script to insert the name of the file. <% updatenewssql = "UPDATE news_tbl SET news_image = '" & Upload.UploadedFiles(fileKey).FileName & "' Where news_id = " & Request.Form("news_id") & " " set updatenews = crofts.execute(updatenewssql) %>
Insert Query
i have problem inserting value with special characters such as email address: anne.walker7@btinternet.com and creditcard:1111 2222 3333 4444 number with spaces inbetween the numbers as these special characters are reserved in MS Access. Any help email = "anne.walker7@btinternet.com" cardnumber = "1111 2222 3333 4444" sql "insert into users (email, cardnumber) " &_ sql = sql & "values ('" & email & "'," cardnumber & ")"
Getting The ID From An Insert Statement
I am using ASP to talk to an SQL database. Most of my tables have a primary key named 'ID'. Is there a way to grab the ID of a record in the same line as the INSERT statement?
INSERT Statement
For some reason my page is giving me the dreaded syntax error. Can anyone see what is wrong? It's probably something simple...it always is.Code: sql_insert2 = "insert into users (PayrollNo, Firstname, Lastname, Password) values ('" & Payroll & "', '" & Firstname & "', '" & Lastname & "', '" & Password & "')" Con.Execute (sql_insert2)
MASS Insert Using ASP/SQL
I have a table in SQL server, that has three columns: ID, Asset, Keywords. i.e. ID Asset Keywords 1 Car Mercedes 2 Car Toyota 3 Color Blue Ok, what I'm trying to do through my asp page (since I cannot do it through SQL, seeing as how it appears that what I want to achieve would be outside the scope of why it was created)... is I'm trying to run a query that will get a list of the assets available and then string the keywords for that asset to a variable. Code:
Insert Error
<% sqlQuery = "INSERT INTO contacts (firstname, lastname, email, department) VALUES (" & contact_first & ", " & contact_last & ", " & contact_email & ", " & contact_department & ")" connect.Execute sqlQuery %> The error I'm getting is Microsoft VBScript runtime error '800a01a8' Object required: '' /ebusiness0405asp/greg/asp/project/adminContactAdded.asp, line 57 Line 57: connect.Execute sqlQuery Ideas?
|