Hi,
I am having a problem adding a new record to an access database on my website, using ASP. Here is the code:
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="../includes/DatabaseConnect.asp"-->
<!--#include file="../includes/adovbs.inc"-->
<%
'Opens the Mix Recordset
Dim rsMixes
Set rsMixes = Server.CreateObject ("ADODB.Recordset")
rsMixes.Open "tblMixes", dbIntense, , adLockOptimistic, adCmdTable
With rsMixes
.AddNew
.Fields("DJ_ID")=Request.Form("frmDJID")
.Fields("Genre")=Request.Form("frmGenre")
.Fields("Length")=Request.Form("frmLength")
.Fields("Type")=Request.Form("frmType")
.Fields("Date")=Now
.Update
End With
%>
<%
rsMixes.Close
Set rsMixes = Nothing
dbIntense.Close
Set dbIntense = Nothing
%>
This throws up the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/intense/admin/register_mix.asp, line 34
(Line 34 is actually the ".Update" line before the "End With", I just took out all the rubbish from my code before posting lol)
This code works fine if I comment out the ".Fields("Date")=Now line.
The Date field in the access database is a Date/Time format.
Any suggestions anybody? could it be some setting on my server I need to change?
Any help is greatly appreciated!
Cheers,
Matthew