Reply
Aap and Access .Update problems
Old 05-05-2004, 04:25 PM Asp and Access .Update problems
Junior Talker

Posts: 3
Hullo all,

Ive been out of the asp water for awhile(since college, really) and I have recently been asked to fix our companies site. I am having a problem adding to an access database.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
/tmp1/process.asp, line 31

Code:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file = "adodb.asp"-->
<%
'########################
'File: proccess.asp
'Author:
'Date: 5.5.04
'Purpose: to add form data to tmp.db and display download
'Last modified: 5.5.04
'########################

'open recordset
dim objRS
set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "contact", objConn, , adLockOptimistic, adCmdTable
'end open

'Read form data (post) into DB
objRS.AddNew
objRS("name") = request.form("name")
objRS("company") = request.form("company")
objRS("phone") = request.form("phone")
objRS("email") = request.form("email")
objRS("contact") = request.form("contact")
objRS("hear") = request.form("hear")
objRS("date") = Date & Time
objRS.Update
objRS.Close
Set objRS = nothing
'end read

'close connection
objConn.Close
set objConn = nothing
'End close
%>

Line 31 happens to be objRS.Update
why is this happening, Ive been working over it for awhile now and have turned to the web. any help would be appreciated. I haven't worked with this in years.

Last edited by CorpusCorvus : 05-05-2004 at 05:29 PM. Reason: mistyped title
CorpusCorvus is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-06-2004, 03:55 PM
Junior Talker

Posts: 3
Sigh... stupid, stupid mistake. Date, of course, is a reserved word. fixed it, works perfect
CorpusCorvus is offline
Reply With Quote
View Public Profile
 
Old 05-06-2004, 10:31 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Glad you figured it out. Those reserved words can be a reall pain sometimes.
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Old 05-11-2004, 01:29 PM
Junior Talker

Posts: 3
Sigh, again...

I asked for the host info ages ago, but never received it. The site is finished, very elegant, and very efficient. Unfortunately, our site is hosted on a freeBSD-Unix server. No ASP allowed. Looks like I get to take a crash course in PHP.
CorpusCorvus is offline
Reply With Quote
View Public Profile
 
Old 05-11-2004, 02:32 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Is it possible to move to a windows host... it'd be alot easier the rewritting your whole site.
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Reply     « Reply to Aap and Access .Update problems
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11795 seconds with 13 queries