Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: INSERT error


Message #1 by "Tim Lyons" <lyno@h...> on Wed, 17 Jul 2002 23:03:34
what's wrong with this clause:

TapeOrder = "INSERT INTO TapeOrder (UserID, Date) VALUES ('"&Session
("username")&"','"&visit&"') "

after it i have theConn.Execute(TapeOrder)

my error states that there is a syntax error in the INSERT INTO statement

TL
Message #2 by "Larry Woods" <larry@l...> on Wed, 17 Jul 2002 15:13:56 -0700
Put "#" signs around the date instead of "'" 's.  Also, is
"UserID" and "UserName" the same thing; i.e., "UserID" is a
string?

Larry Woods - MCSD,MCT

> -----Original Message-----
> From: Tim Lyons [mailto:lyno@h...]
> Sent: Wednesday, July 17, 2002 11:04 PM
> To: Access ASP
> Subject: [access_asp] INSERT error
>
>
> what's wrong with this clause:
>
> TapeOrder = "INSERT INTO TapeOrder (UserID, Date)
> VALUES ('"&Session
> ("username")&"','"&visit&"') "
>
> after it i have theConn.Execute(TapeOrder)
>
> my error states that there is a syntax error in the
> INSERT INTO statement
>
> TL
>

Message #3 by "Ken Schaefer" <ken@a...> on Thu, 18 Jul 2002 11:17:00 +1000
suggest you do this:

Response.Write(TapeOrder)
Response.End

and look at the resulting output. I have some FAQs here:
www.adopenstatic.com/faq/
that deal with common situations that cause Syntax errors (for example I
suspect its because you have a field called "date"

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Tim Lyons" <lyno@h...>
Subject: [access_asp] INSERT error


: what's wrong with this clause:
:
: TapeOrder = "INSERT INTO TapeOrder (UserID, Date) VALUES ('"&Session
: ("username")&"','"&visit&"') "
:
: after it i have theConn.Execute(TapeOrder)
:
: my error states that there is a syntax error in the INSERT INTO statement

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index