SQL Insert Statement

M

Mike Mueller

I am having problems implementing an Insert statement.
Here is the code:
strSQL3 = "INSERT INTO Usage (User, TimeStamp) VALUES ('"&
strUserName &"', (Now ()))"

Here is the error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in
INSERT INTO statement.

/secure/validate.asp, line 29

Haven't gotten farther yet on this, but how would I execute
this? Would I just call up that variable or ???

TIA

Mike
 
C

Carmen

One too many close brackets .

strSQL3 = "INSERT INTO Usage (User, TimeStamp) VALUES
("& strUserName &", Now ())"
 
C

Carmen

Oops. Messed up your variable on the last reply.

strSQL3 = "INSERT INTO Usage (User, TimeStamp) VALUES
('"& strUserName &"', Now ())"
 
C

carmen

Sorry, was out of the office for a few days.

Make your TimeStamp variable strTime, then try it like
this:

strSQL3 = "INSERT INTO Usage (User, strTime) VALUES
('"& strUserName &"', Now ())"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top