DB Insertion Problem
My page is acting as if it is working but it is not depositing the values into the db. Should I be using a update query? My response.write statement is perfect as follows:
Code:
My page is acting as if it is working but it is not depositing the values into the db. Should I be using a update query? My response.write statement is perfect as follows:
Code:
I have a data entry form. If the user submits the form without entering any data, the record should be inserted with null entries for the respective fields.
But when i execute the INSERT SQL query with these null values, it gives me an error.
This is vat I am doing:
<%
.....
address = request.form("address")
if request.form("Age")= "" then
ageValue=""
.....
.....
%>
I use these values in SQL query
This is the SQL statement when the above is executed
" INSERT INTO tblStatistics (Age,address) VALUES (, aaa)"
Because of no value for age, the query is not gettin executed.
I dont want a 0, I want a nul entry (<null>).
Could someone throw some light on how to set the age field to null?
I have a lil text box that I use to insert into a db. It inserts fine, but anytime i post something like
he said "i don't know" how to do this
the only thing that shows up is everything before the quote.
Am I suppose to be doing a replace for quotes also or does it only apply to apostrophes?
A page I'm working on contains a registration form which is supposed to a) update an Access database using ASP and b) email the contents of the submitted form to the camp administrator.
This is my first experience with ASP, and with any kind of database interfacing language, for that matter. Currently I'm struggling with the record insertion. I'll worry about email afterwards.
I'm using Dreamweaver 8, which is generating all the code for me. I have a testing server set up on my local machine (in my working directory, in fact). I've told DW to connect to the databse (located in %siteroot%/database) through the testing server using a DSN (same DSN as on the web server). Code:
I'm trying to write a page that will accept form POST method variables from another page and save them to an Access database via a DSN connection. I'm using code like this:
<%
SQL = "INSERT INTO myTable (postVar1,postVar2,postVar3)"
SQL = SQL & " VALUES ('" & request.form("postVar1") & "','" & request.form("postVar2") & "','" & request.form("postVar3") & "')"
dsnConn.execute(mySQL)
%>
I'd like to make sure that I clean up the text that the user inputs before trying to send it to the database. Can someone please give me an example of what ASP code I need use to get rid of quotes, slashes, and anything else a user could enter that might mess up the SQL insert?
anyone have a quick example of using insertion point of data with MSWC.Tools ?
e.g. how can I send data to "div" tag ?
Set oTools = Server.CreateObject("MSWC.Tools" )
oTools.processForm "output.asp", "template.asp", "<div>"
I have a Dynamic product page that displays the items using "DO UNTIL rs.EOF" and I have assigned form input type to be hidden(for some) for information that I would like to retrieve. On the product page I have a "Add to Cart" button which points to my "addCart.asp".
addCart.asp is where I would insert the items into a Table called "cartItems" in the Database when the user clicks on the "Add to Cart" button.
My "addCart.asp" now generates a "Syntax error in INSERT INTO statement." which I think is caused by my inability to filter for the values from the product page and insert it into the "cartItems" table. Code:
I am using ASP Upload to upload an image to a website. I have other form fields in the form that are used to obtain data and are inserted into an access database. This occurs on the same page as the page that upload the image. Everything works fine except it inserts each record twice into the database. Anyone have an idea what causes this or what I can do to make it only insert once. I am useing the progress bar and don't know if that has anything to do with it. Here is my code.
Set rsPhoto = Server.CreateObject("ADODB.RecordSet")
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.ProgressID = Request.QueryString("PID")
Upload.SetMaxSize 500000, True
Upload.Save ....
i have written a stored procedure. depending upon different parameters, query is prepared as string and executed through exec() function. it returns a certain number of rows. stored procedure also contains a temporary table. the question is this how can i insert the rows returned by the query in to temporary table?
View Replies View Relatedanyone have an example of using insertion point of data with MSWC.Tools ?
e.g. how can I send data to a "div" tag ?
Set oTools = Server.CreateObject("MSWC.Tools" )
oTools.processForm "output.asp", "template.asp", "<div>"
I need to know how to handle errors if a write to the database fails. Here's the pseudo-code:
View Replies View RelatedI'm using CDO to send mail to the site owner from ASP pages with forms.
Recently one of my forms is occasionally sending email with what seems
to be an insertion which is replacing the plain text part of the email
with something else. Looking at the server sent email source, the
hacked emails have the following: