I have an “ancient” webpage that I need to instill some databasing capabalities into it, and I’m afraid I’m at a loss as I can’t find a good enough resource on how to do that and how the queries goes as far as classic ASP.
so this is basically how it goes, I have a form validator which is written in jQuery, once the form is validated, I want to use a $.post request to send the data to a form processor (some sort of classic asp file).
I tried using Request.Form(“field”) but it isn’t working.
I tried even using a $.get request using Request.QueryString(“field”) and I have no success there aswell.
some code:
Dim sConnection, objConn , objRS
sConnection = "connection string"
username = Request.QueryString("username")
sitename = Request.QueryString("site_name")
email = Request.QueryString("email")
comment = Request.QueryString("comment")
dataInsert = ("INSERT INTO larrydb_review (username, sitename, email, comment, rating) values (username, sitename, email, comment, rating)")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnection)
objConn.Execute dataInsert
I’m assuming that the SQL Query string isn’t written correctly, but I afraid I haven’t found where to write one properly using asp variables.
Any help will be greatly appreciated,
Thank you.
If you are using the METHOD = POST in your form, to retrieve the data sent in your ASP page:
then to update the SQL Table you have to create a dynamic string as:
Also your variable sConnection = “connection string” must be properly fill with the connection string for your database like this example: