Jill wrote:
I am trying to store the current date to an ms access database on my
server. I set it up with a dsnless connection.
Here is the statement:
Insert Into employees(times tamp) Values ('" & date() & "')"
the timestamp field is of type date/time in the ms access database.
I get an error saying the insert statement is invalid. Cannot get
you the exact error, my server is down.
But it seems that the syntax is correct.
Actually, it isn't. Date literals in JetSQL need to be delimited with hash
marks (#), not quotes (').
However, in this case, you should use the builtin JetSQL date() function,
rather than concatenating in te result of the vbscript date() function:
Insert Into employees(times tamp) Values (date)
Since the date function is not a literal, you don't need to delimit it.
In the future, if you do need to pass values from vbscript to queries, I
suggest using saved parameter queries:
http://www.google.com/groups?hl=en&l...TNGP12.phx.gbl
If for some reason, you have an aversion to or are unable to use saved
parameter queries, you can use a Command object to pass parameters to sql
statements constructed in your vbscript code:
http://groups-beta.google.com/group/...e36562fee7804e
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"