INSERT Statement
The block of code below shows how I am inserting field values into my dbase table:
strSQLStatement = "INSERT INTO tblArticles
(handid,ArticleDate,sport,articleheader, fpick,articleText) "_
& "SELECT '" & handid & "' As handid, '" _
& ArticleDate & "' As ArticleDate, '" _
& sport & " As sport, " _
& articleheader & "' As articleheader, '" _
& fpick & "' As fpick, '" _
& articleText & "' As articleText;"
Conn.Execute(strSQLStatement)
but I am getting an "Insert statement contains fewer items than the insert list" error , when in fact I am not (both 6 field names).
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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.
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:
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)
Insert SQL Statement
how can i write an insert whereby.my attributes in Mainshift table is shiftdate, line, shift & description. ShiftDate and Line is the primary key.so i want to insert the shiftdate, from today's date until around 31st Dec 2008 and line i want to do a select distinct statement where i will extract from execmaster table. for the shift i want it to be a default "2". for the description all is all "working day"can anyone help on how to write an insert statement on this?
INSERT Statement
This variable, dteEmpDow = WeekdayName(Weekday(Date)), produces this error when using an INSERT statement to Access db: Microsoft JET Database Engine error '80040e07' Data type mismatch in criteria expression. The Access db field is set to recieve a date/time data type.do I have to convert it somehow?
Insert Statement
I am using simple insert statement that works fine but it doesn't work when you put " ' ", for example "let us" works not " let's us" because of ' sign.... is there anyway user can add anything?
ASP Variables And INSERT Statement
Can any one tell me what is wrong with this insert statement: sql = "INSERT INTO Questions (Question,SurveyId,CatId) VALUES ('" & question & "','" & surId & "','" & Sig &"') " and why when I print it to screen, it shows this: INSERT INTO Questions (Question,SurveyId,CatId) VALUES 'this si a test','38, 3',''); I have used similar and it works, they are the right values bit wont work..?
Performing Insert Statement
I have a asp page that contains link(A href tag) to some other page.When the user clicks on the link ,I want to perform a insert SQL statement and then link it to target page.Is it possible?
Building An INSERT Statement In ASP 30
I have an old web app that ues an Access database and ASP 3.0. I need to build an INSERT statement based on the contents of a form. What is the best way to handle blank text boxes that are submitted with the form? For example, I collect all my name/value pairs that are submitted with the form like this... Code:
Insert Statement-check
Can somebody check the insert statement i have written?Ofcourse it is giving error.But what i am trying to accomplish here is i want the records to be inserted and then after the records are inserted ,i want it to be sorted and then displayed onto the page.i modified my insert statement to accomplish the same ,but i am sure its totally wrong. After performing insert..i want to display records in a ascending order..how do i do that? here is my isnert statement: Code:
Problem With Insert Statement
Been trying this for over 2 hours now, and I can't seem to figure it out. I tried browsing these forums for any clues but can't find a problem quite like mine. Dim conn, rs Set conn = Server.CreateObject("ADODB.Connection") conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("database.mdb") & ";" sql = "INSERT into booking(numid, carNo, workshop, bookDate, bookTime, status) VALUES('"& tempNum &"', '"& carno &"', '"& workShop &"', '"& bookDate &"', '"& bookTime &"', '"& status &"')" conn.Execute (sql) I keep getting a "Operation must use an updatable query" error message.
Insert Statement Problem
Having a problem with my change password code. It bombs on the INSERT statement.....I get an error stating thier is a syntax error in my insert statement but I can't figure out where. The delete statement works fine and yes all the variables are getting passed. Code:
Access Insert Statement
I am used to SQL Server, no Access, but this one thing has to be done in Access. Can you tell me if this query will work, based on the syntax? I am trying create a new row on the database, in one table, and the primary key is an Autonumber called PersonalID. This is on the second page, which shows after the personal has filled out some info on the first page, then submitted the form using POST. Database name is Shape, and table is named Personal. Code:
Error On Insert Into Statement
i have this error on the regisration page of the website i'm doing. Microsoft VBScript compilation error '800a0409' Unterminated string constant /Shop/register_process_corp.asp, line 40 SQL = "INSERT INTO ------------------^ Code:
Insert/select Statement
How can i get the autonumber(primary key value) from the specific rows when i just insert it.Example i just insert the member information. sql="INSERT IMTO register(user,password,address) VALUES (shujuan,841218,singapore)" so how can i get the autonumber value for this row after i just create it.
Pass PK And FK To Do INSERT Statement
Three tables: Registration, Session, Payment: Joined with 1 to many rel. starting with registration, moving to session and ending with payment. Form 1: Registration= INSERT INTO statement works fine. Reg table now has fields populated with form data. Form 2: Session= <<<<<this is where the problem occurs>>>>> Form 3: <<<<<<problem as well>>>>>> When i want to do another INSERT INTO statement, I have to know the RegID from the earlier table join(registration). Of course, I can't run either Form 2 or Form 3 without knowing the RegID from the Registration table begin point. I don't know how to increment the RegID as a foreign key in a joined table over the internet. Using Access over the network it's real easy to pass the foreign keys and the design seems to be more flexible this way, but I need to update tables and present stored data to the user across the internet.
AddNew Or Insert Statement
I want to know the opinion of you all great guys out there whether AddNew method of recordset is better to use & secure than simply a insert statement.
Looping Through SQL Insert Statement
I dynamically load a question into a form along with its answer and its name (1,2,3...). It's name is the the numeric value loaded but I ad on: Code:
Syntax Error In INSERT INTO Statement.
Now I know I posted this elsewhere twice but no one seems to even be looking at them. I really am stumped by this problem. I recieve the error: Microsoft JET Database Engine error '80040e14' Syntax error in INSERT INTO statement. /quizmaker/admin/create_teacher.asp, line 20 DIM mySQL mySQL = "INSERT INTO users(user, password) VALUES('"& uname &"', "& pword &")" USERS1.open mySQL , objConn <----- Line 20.
Syntax Error In INSERT INTO Statement???
Syntax error in INSERT INTO statement. Please download the attachment and unzip it. I have 4 files: Starting with "signup.asp" - fill up the registration form. this will forward you to next form. "signup_process.asp" - process the filled form "signup_success.asp" - indicate that register successfully "Database.mdb" - the database file (MS Access 2000 format) My problem occurs in "signup_process.asp". The error message found in IE: Error Type: Microsoft JET Database Engine (0x80040E14) Syntax error in INSERT INTO statement. /myweb/signup_process.asp, line 31 I look through my code, but found no mistake. But why still I cannot add the information in the form into the "Database.mdb"?
Insert Statement Dropping Values
i'm reading in a .csv file and then inserting the data into a mssql db. batchid sometimes shows up blank. the values that are disappearing begin with the letter "N", such as "NP2338" or "N00312". outside of those that begin with "N", the rest are a five digit number. the table field is varchar. why is it dropping those that begin with "N"?
Problems With Insert Statement Using SSL(Verisign)
I am having problem with the following Insert Statement when used on Production Web server with SSL(https://...., Verisign). This doesn't occur everytime. Our studies shows that it is occurring approximately between1-2% of the total applications/Year(70-80K). After adding some debugging, the insert statement, after failing, is giving the following error: Error NUmber: #-2147217833 Error Desc[Microsoft][ODBC driver for Oracle][Oracle]ORA-01401: inserted value too large for column Ironically, 75% of the time, when the users resubmit the page the record will be inserted. Code:
Syntax Error In INSERT INTO Statement
My Code is as follows, im basically trying to get the value from a radio button from another page for a vote, take the value thats allready in the table add 1 to the value and then insert it back into the database, then create a voted cookie and redirect back to the same page to view the vote results. Code:
Auto-escape INSERT Statement
I have a 'memo' form field being entered into an access database.If people put in characters other then text (Quotes, operators, etc) then I get an insert error: ---- User Input: oh let's see - a va Error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''oh let's see - a va', 'No additional comments submitted')'. ---- Is there a way to get this into the database? In php, I would simply use the function 'addslashes()' (escaping the string) - is there a similar function in ASP or am I doing something else wrong?
INSERT Statement Error In .asp File
I am making a masters page with delete, update , and insert fuctionality, i am using the insert.asp page with a form to submit the data and insert it in the database by prossesing a seperate page called insert_prosessor that has the Insert Statement to insert the data. Now i am having trouble with the insert_prosessor as it's ERROR message reads" syntax error in INSERT Statement" I cant find the problem.. Code:
Question On Syntax Error In INSERT INTO Statement.
Usually on our server we see or can view source to see where in the INSERT statement something got messed up. I have debugging on but when I run a test, I get the following error: Syntax error in INSERT INTO statement. Line 57 It is a very long INSERT statement but for the life of me, I can not see where it is wrong. What I am wondering, if all I am seeing is "Syntax error in INSERT INTO statement. " does this mean it is at the beginning of the statement since i do no see any of the actual data on the error page?
Insert Statement Executing Repeateadly On The Page Refresh
i have a form that action is set to itself, on the same page i m having the insert statement, executed when i submit that form, but when the user refresh that page the query is executed and submit the null values in the table. <form name=form1 action=form1.asp method=post> <input type........ <input type....... <input type=submit value....> <input type=hidden name='insert' value=1> </form> <% if request.form("insert") = 1 then Execute the insert query End If %>
Build DB Insert Statement Dynamically - Loop Form Elements
When you submit the form you can see I am trying to get the each row of the form elements into a format such that I can build multiple insert statements. Here is what I am working with: <% Dim x For x = 1 to Request.Form.Count Response.Write Request.Form.Item(x) Next Would I use some type of Mod operator on the value of x to determine my line breaks?
Error '80040e14' Syntax Error In INSERT INTO Statement
I'm having a very difficult time with an ASP page that I develpoped in Dreamweaver and the MS Access DB it's supposed to update. When I submit the data the following error appears: Microsoft JET Database Engine error '80040e14' Syntax error in INSERT INTO statement. /sessiondata2.asp, line 115 I know this is usually a reserved word issue but I don't think that's the case here because the page updates perfectly when executed on my computer as a testing server. The rest of the site updates data into the database properly so I know the connection string is working. I can't figure out what would throw an error on a live server when there isn't one on a testing server. Code:
WHERE Statement
cant get to grips with this problem, need to select from dbo.booking_form all records that meet 2 statements. 1st allocated='completed' and 2nd account is not 'CASH' , i.e. all records that don't contain the word CASH in the field 'ACCOUNT' Below is the beginning just don't know the syntax for NOT, have tried several option but to no avail. Pricing.Source = "SELECT * FROM dbo.booking_form WHERE allocated = 'COMPLETED' AND
If Statement
If a user enters in this to search a db "Jon Doe" James Doh return all of the exact matches Jon Doe (user uses quotes to clarify an exact search) along with that: return all of the James and all of the Doh as well qry to look like this as soon as I am able to divide up the string entered in by the user select * from table where (NAME LIKE '%Jon Doe%') or (NAME LIKE '%James%') or (NAME LIKE '%Doh%') Thinking of using the instr to find the " but then what do I do to find the string inside of the two quotes, One quote would be easy. there is a couple of checks to preform:anyone run into this before or have any ideas/samples, etc
Sql Statement ?
I have created a query wizard page with ddl as your choice to find info. now each ddl has a default of a dash. The thing is I want to do is have the sql statement to look through the database even when some of the ddl have a dash on them. or just ignore the ones with a dash and look for the ones that are selected. Is there any suggestions for this.
ASP If Statement
Below is my code for a question system i have created. However, i need to insert an if statement that redirects the user to test.asp if the value of q_id is not in my database, but i dont know how to do it? <% q_id = request("q_id") sql = "SELECT * FROM questions WHERE PARENT_ID = 1" Set objRS2 = Server.CreateObject("ADODB.Recordset") objRS2.Open sql, objConn sql_sql = "SELECT * FROM questions WHERE PARENT_ID = " & q_id Set objRS3 = Server.CreateObject("ADODB.Recordset") objRS3.Open sql_sql, objConn %>
AND Statement
my AND statement is not working and I dont know why???? sql = "SELECT * FROM calls WHERE tech=" & userID "AND status = Open" tech and status are the DB fields userID is a variable Open is just a word
Sql Statement
I am trying to store the current date to an ms access database on my server. I set it up with a dsnless connection. Here is the statement: Insert Into employees(timestamp) Values ('" & date() & "')" the timestamp field is of type date/time in the ms access database. I get an error saying the insert statement is invalid. Cannot get you the exact error, my server is down. But it seems that the syntax is correct.
SQL Statement
I've got a products table which holds a description field. I'm trying to pull only records which contain the word RUSTIC in the description. Examples of what I'm talking about might be: 3" Rustic White Oak, or Rustic 3" Red Oak. Upon reading some guides I've come up with the following...which returns nothing. SELECT * FROM products WHERE productDescription LIKE '%rustic%'
SQL Statement
What is wrong with my code? This is the error. Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'CLASSDATE >= 6/23/2004 ORDERBY CLASSDATE'. This is the code. Code: strSQL = "Select * FROM WellClass WHERE CLASSDATE >= " & DATE & " ORDERBY CLASSDATE"
SQL Statement
I Am Creating A Room-Booking System. The Establishment I'm Making For Has 6 Periods Of Time A Day. Any Examples Of A Statement I Could Use Whuch Searches A "Day" Field For 6 Identical Dates, And If It Does, Says "Fully Booked" Or Something?
SQL Statement
I have an Access database of literature that I want to search using an ASP page using multiple search criteria (author, title, year, discipline,etc). I'm using a form to collect the criteria from the user and then sending it to an ASP page. I'm creating the SQL statement using variables that pick up values passed from the form. Code: strSQL = "SELECT * FROM Literature WHERE " & _ "(Author Like '%" & mauthor & "%') AND " & _ "(Title Like '%" & mtitle & "%') AND " & _ "(Journal Like '%" & mjournal & "%') AND "& _ "(ArticleBook Like '%" & mBookOption & "%') AND " & _ "(Year Like '%" & myear & "%') " & _ "ORDER BY Title ASC;" This would probably work if I used "OR" in my SQL, but I want to be able to use "AND." My problem is that I'm not getting records that have null values in some of these fields.
If..Else Statement
i make a form with an AccountId box on it , when u enter the accountid in the box , and submit it will send u to a page that show u all the data for this accountid(retreive data) until here everything is ok , and when i enter for ex. accountid : 5 , all the aacountid fiel data will be show to me , but the problem when i enter am unvalid accountid , it will give the error page that what iwant to do that i want when i enter an unvaildaccountid an error text show to me like response.write("The Id that u entered is unvaild , Try Again") and this is the code , if u can change on it Code:
IF Statement
I am trying to use the following IF statement, and whenever I use a single or double quote, I receive a syntax error. When using no quotes, the syntax is accepted, but the statement does not perform properly. ***The problem line*** <% if violation_type=''Tardy'' THEN %> ***rest of the statement*** TARDY VIOLATIONS <% if rs2.Fields(0) = 0 THEN %> This is the first unexcused Tardy violation for this employee. A coaching is required. Click <A HREF=blah>HERE</Ato issue the coaching. <% ELSE %> This employee has <%response.write(rs2.Fields(0))%previous violations. <% END IF %> <% ELSE %> The <%response.write(violation_type)%violation has been recorded. <% END IF %> Variables defined: violation_type = request.form("violation_type")
If/Then Statement
On a page with a form (post method) and a hidden field "Process value = true", why would this statement not work: <% if request.Form("Process") = "true" THEN The code in here sends an email to the user via CDOSYS End IF %> This is what I have going on and it does not send the emal when the form is posted. Removing the If statement obviously sends the email the moment the form page is accessed, but thats not right.
SQL Statement
I am getting Syntax error saying Missing operator in query expression. sql= "SELECT qryReferral_report.Employee, Sum(qryReferral_report.Amount) AS SumOfAmount, Count(qryReferral_report.ID) AS CountOfID" sql= sql & " FROM qryReferral_report" sql= sql & " WHERE (((qryReferral_report.CDate) Between #" & Date1 & "# And #" & Date2 & "#) AND ((qryReferral_report.StatusID)='C'))" sql= sql & " GROUP BY qryReferral_report.Employee" sql= sql & " Count(qryReferral_report.ID) DESC;" I'm not real good at SQL, so I don't know what I'm missing. I think it has to do with the Sum and Count statments.
Statement Not Following
i have a couple of if statements and it goes something like this, the user will try entering their username and password in the login page then they will be taken to a verify page, then it will decided if the user can be send to the login page again or to the invalid page. The problem is that after 3 times the user is still send to the login page and not the invalid page My verify page code is :- <% session("try") = try if try = "" then try = 0 else try = try + 1 end if if try <> 3 then response.redirect("login.asp") else response.redirect("invalid.asp") end if
|