|
-
Jul 29th, 2000, 12:48 AM
#1
Thread Starter
Member
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>
-
Jul 29th, 2000, 09:07 PM
#2
Fanatic Member
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
-
Jul 30th, 2000, 12:12 PM
#3
Guru
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 & "')"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|