-
Hello i am new in asp but i know VB :)
This is my pages
But i get error her :strSQLQuery = "insert into table1( Name, Date) values('" & UserName & "','" & date & "')"
and Her :rs.Open strSQLQuery, conn , 3, 3
<html>
<%
Dim UserName
Dim Conn
Dim rs
dim strSQLQuery
UserName=Request.QueryString("Name")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\db1.mdb")
strSQLQuery = "insert into table1( Name, Date) values('" & UserName & "','" & date & "')"
response.write strSQLQuery
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQLQuery, conn , 3, 3
response.write UserName
Set rs= Nothing
%>
<html>
-
What is the error message you are getting? It could be the way you are inserting the date into the recordset. What format is the date you are using in the table? It has to match what's being entered, in the SQL.
short date : 7/29/00
medium date : 29-JUL-00
long date : Saturday, July 29, 2000
general date : 7/29/00 10:01:23 PM
-
DATE is a reserved keyword (probably NAME as well), put brackets around these in your SQL statement:
strSQLQuery = "insert into table1( Name, Date) values('" & UserName & "','" & date & "')"
should be
strSQLQuery = "insert into table1( [Name], [Date]) values('" & UserName & "','" & date & "')"