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?
I am inserting records into an Access table using the OleDbCommand class. The insert values come from a basic web form with text boxes. If the values contain ' or " it creates a problem. What is the proper way to escape these characters? Surely there's a built-in function for it somewhere.
i have a field with a list of wrong ID (random) and i wish to replac them with a sequential (auto-increment) value. how to remove the valu and to add in the sequential ID?
Im running a select statement to a database and wish to display the relevant records into a table. For some reason, its not liking this - can someone see why, and or tell me an easier way to produce an 'automatically generating' table of results.
<body bgcolor="#FFFFFF" text="#000000"> <!-- #include file="dbConn.asp" --> <!-- #include file="adovbs.inc"--> <h1>Your search results returned the following popup messages:</h1> <% Dim msgtype, title, message, url msgtype=request.form("type") title=request.form("title") message=request.form("msg") url=request.form("URL")
Dim adoDB, adors, strSQL set adoDB = Server.CreateObject("ADODB.Connection") adoDB.Open strConnection set adoRS = Server.CreateObject("ADODB.RecordSet") strSQL="SELECT PID,P_TITLE,P_MSG,P_URL,P_TYPE FROM POPUP WHERE (" If msgtype <> "" then strSQL=strSQL & "P_TYPE='" & msgtype & "' " If title <> "" then strSQL=strSQL & "OR P_TITLE LIKE '%" & title & "%' " If message <> "" then strSQL=strSQL & "OR P_MSG LIKE '%" & message & "%' " If url <> "" then strSQL=strSQL & "OR P_URL LIKE '%" & url & "%' " End if strSQL=strSQL & ")"
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?
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?
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....
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
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?
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:
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:
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") & ";"
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:
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:
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.
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.
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"?
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:
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"?
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:
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: