inseting records to a database through html code...

liunx

Guest
hi,,, i have this html page that consists of fields name,tel,etc...
i want when the user fills the fields and presses submit the data will be stored in the database,,,
the database is stored in this path:C:\Documents and Settings\NooraS\My
Documents\noora\Ammar\myweb71")_
i wrote this code but it doesn't store the data , any help:

HTML Code:
<%
set myconn = server.createobject("adodb.connection")
dbpath = server.mappath("C:\Documents and Settings\NooraS\My
Documents\noora\Ammar\myweb71")
connection = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & dbpath & "\Ammar.mdb"
myconn.open (connection)
set result = server.createobject("adodb.recordset")
set result = myconn.execute(strSQL )

%><%
dim strSQL
set myconn = server.createobject("adodb.connection")
set dbpath = server.mappath("C:\Documents and Settings\NooraS\My Documents\noora\Ammar")
connection = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & dbpath & "\Ammar.mdb"
myconn.open (connection)
set result = server.createobject("adodb.recordset")
set result = myconn.execute(strSQL )

strSQL = "INSERT INTO [Buy_info](name, address,Tel/Mobile, Product description, Credit card number) Values ('" &name & "' , '" & address & "' , '" & tel & "' , '" & products_des & "' , '" & cc_no & "' )"
myconn.execute(strSQL)
%>Please this is urgent i need someones helpWhat you have there isn't HTML. It appears to be a server-side programming language. I'll just move the thread over there for you.

PegThe code you presented is asp connecting to access database. There is a asp subforum here and the quickest method would have been to post there.
Question is
Does it give you and sql or asp error?no it doesn't give me an error, but when i check the database no records are savedwhere are you assigning values to these variables?

'" &name & "' , '" & address & "' , '" & tel & "' , '" & products_des & "' , '" & cc_no & "'these values are assigned to the values stored in my databasehuh? on an insert statement they should be assigned on the page and passed to thhe database.
 
Back
Top