Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Missing semicolon (;) at end of SQL statement.


Message #1 by "Eric" <eric@d...> on Sat, 22 Jun 2002 11:05:05 -0400
Hi all.. 

Getting an error I can't seem to figure out.  When INSERTing a record
into Access, I am getting the following error:

Microsoft JET Database Engine error '80040e14' 
Missing semicolon (;) at end of SQL statement. 
/test/subrep/functions/color_mgmt.asp, line 249 

The code is as follows:
objComm.CommandText = "INSERT INTO tblColors " & _
	"([style_id], [color], [color_adjustment], [color_promotion]) "
& _
	"VALUES (" & _
	Request("style_id") & _
	", " & g_sqlText(UCase(Request("new_color"))) & _
	", " & curAdj & _
	", " & curPromo & ") " & _
	"SELECT @@IDENTITY AS 'strColorID'"

If I put a semi-colon after the INSERT command, I am getting an error
stating there are extra characters after the SQL statement, and if I put
the semi-colon after the SELECT command, the same error as above gets
thrown.

Many thanks.

Regards,
Eric


Message #2 by "Rob Parkhouse" <rparkhouse@o...> on Mon, 24 Jun 2002 00:43:17
> Hi all.. 

Getting an error I can't seem to figure out.  When INSERTing a record
into Access, I am getting the following error:

Microsoft JET Database Engine error '80040e14' 
Missing semicolon (;) at end of SQL statement. 
/test/subrep/functions/color_mgmt.asp, line 249 

The code is as follows:
objComm.CommandText = "INSERT INTO tblColors " & _
	"([style_id], [color], [color_adjustment], [color_promotion]) "
& _
	"VALUES (" & _
	Request("style_id") & _
	", " & g_sqlText(UCase(Request("new_color"))) & _
	", " & curAdj & _
	", " & curPromo & ") " & _
	"SELECT @@IDENTITY AS 'strColorID'"

If I put a semi-colon after the INSERT command, I am getting an error
stating there are extra characters after the SQL statement, and if I put
the semi-colon after the SELECT command, the same error as above gets
thrown.

Many thanks.

Regards,
Eric


Suggest if you haven't already done so, setting the SQL up in a string 
variable and then displaying with Response.Write to make sure the SQL is 
what you think it is.

Message #3 by "Ken Schaefer" <ken@a...> on Mon, 24 Jun 2002 13:09:19 +1000
Eric,

Jet does not support batched SQL statements. You will need to execute them
one at a time.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Eric" <eric@d...>
Subject: [access_asp] Missing semicolon (;) at end of SQL statement.


: Getting an error I can't seem to figure out.  When INSERTing a record
: into Access, I am getting the following error:
:
: Microsoft JET Database Engine error '80040e14'
: Missing semicolon (;) at end of SQL statement.
: /test/subrep/functions/color_mgmt.asp, line 249
:
: The code is as follows:
: objComm.CommandText = "INSERT INTO tblColors " & _
: "([style_id], [color], [color_adjustment], [color_promotion]) "
: & _
: "VALUES (" & _
: Request("style_id") & _
: ", " & g_sqlText(UCase(Request("new_color"))) & _
: ", " & curAdj & _
: ", " & curPromo & ") " & _
: "SELECT @@IDENTITY AS 'strColorID'"
:
: If I put a semi-colon after the INSERT command, I am getting an error
: stating there are extra characters after the SQL statement, and if I put
: the semi-colon after the SELECT command, the same error as above gets
: thrown.


Message #4 by "Eric" <eric@d...> on Sun, 23 Jun 2002 23:16:32 -0400
Thanks Ken...

As you may have seen from the thread... after much trial and error I did
exactly that... for the Jet version of the application, I separated the
two SQL statements, where for the SQL version I left it as one.

Regards,
Eric

-----Original Message-----
From: Ken Schaefer [mailto:ken@a...] 
Sent: Sunday, June 23, 2002 11:09 PM
To: Access ASP
Subject: [access_asp] Re: Missing semicolon (;) at end of SQL statement.

Eric,

Jet does not support batched SQL statements. You will need to execute
them
one at a time.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Eric" <eric@d...>
Subject: [access_asp] Missing semicolon (;) at end of SQL statement.


: Getting an error I can't seem to figure out.  When INSERTing a record
: into Access, I am getting the following error:
:
: Microsoft JET Database Engine error '80040e14'
: Missing semicolon (;) at end of SQL statement.
: /test/subrep/functions/color_mgmt.asp, line 249
:
: The code is as follows:
: objComm.CommandText = "INSERT INTO tblColors " & _
: "([style_id], [color], [color_adjustment], [color_promotion]) "
: & _
: "VALUES (" & _
: Request("style_id") & _
: ", " & g_sqlText(UCase(Request("new_color"))) & _
: ", " & curAdj & _
: ", " & curPromo & ") " & _
: "SELECT @@IDENTITY AS 'strColorID'"
:
: If I put a semi-colon after the INSERT command, I am getting an error
: stating there are extra characters after the SQL statement, and if I
put
: the semi-colon after the SELECT command, the same error as above gets
: thrown.





Message #5 by "Ken Schaefer" <ken@a...> on Mon, 24 Jun 2002 14:16:47 +1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Eric" <eric@d...>
Subject: [access_asp] Re: Missing semicolon (;) at end of SQL statement.


: Thanks Ken...
:
: As you may have seen from the thread... after much trial and error I did
: exactly that... for the Jet version of the application, I separated the
: two SQL statements, where for the SQL version I left it as one.

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

I don't see any thread on this list. I can see one reply from Rob Parkhouse
suggesting you Response.Write() your SQL statement...(plus my reply).

Cheers
Ken


  Return to Index