Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Incorrect syntax near keyword 'WHERE'


Message #1 by "Jake C" <jakeone@b...> on Tue, 3 Apr 2001 14:26:19
Hi there, 



I keep getting an error, "Incorrect syntax near the keyword 'WHERE'".  My 

code reads as follows:



objRS.Open "INSERT INTO Contacts(CompWebsite,CompLogo," &_

"CompName,ContactFName,ContactLName," &_

"ContactWorkTel,ContactMobileTel,ContactEmail," &_

"ContactFax,ContactAddress1,ContactAddress2," &_

"ContactTown,ContactCounty)" &_

" VALUES('" & CompWebSite & "','" & CompLogo & "','" & CompName & "'," &_

"'" & ContactFName & "','" & ContactLName & "'," &_

"'" & ContactWorkTel & "','" & ContactMobileTel & "'," &_

"'" & ContactEmail & "','" & ContactFax & "'," &_

"'" & ContactAddress1 & "','" & ContactAddress2 & "'," &_

"'" & ContactTown & "','" & ContactCounty & "'," &_

" WHERE loginID = '" & Session("loginID") & "'", Con, adOpenStatic, 

adLockOptimistic



Can anyone spot what I'm doing wrong?  I've verified my connection is 

correctly setup, as is my session variable. Thanks for any help you can 

give.
Message #2 by "Blake, Shane" <Shane.Blake@p...> on Tue, 3 Apr 2001 10:17:03 -0400
there is no WHERE in an INSERT...



shane



-----Original Message-----

From: Jake C [mailto:jakeone@b...]

Sent: Tuesday, April 03, 2001 10:18 PM

To: ASP Databases

Subject: [asp_databases] Incorrect syntax near keyword 'WHERE'





Hi there, 



I keep getting an error, "Incorrect syntax near the keyword 'WHERE'".  My 

code reads as follows:



objRS.Open "INSERT INTO Contacts(CompWebsite,CompLogo," &_

"CompName,ContactFName,ContactLName," &_

"ContactWorkTel,ContactMobileTel,ContactEmail," &_

"ContactFax,ContactAddress1,ContactAddress2," &_

"ContactTown,ContactCounty)" &_

" VALUES('" & CompWebSite & "','" & CompLogo & "','" & CompName & "'," &_

"'" & ContactFName & "','" & ContactLName & "'," &_

"'" & ContactWorkTel & "','" & ContactMobileTel & "'," &_

"'" & ContactEmail & "','" & ContactFax & "'," &_

"'" & ContactAddress1 & "','" & ContactAddress2 & "'," &_

"'" & ContactTown & "','" & ContactCounty & "'," &_

" WHERE loginID = '" & Session("loginID") & "'", Con, adOpenStatic, 

adLockOptimistic



Can anyone spot what I'm doing wrong?  I've verified my connection is 

correctly setup, as is my session variable. Thanks for any help you can 

give.

Message #3 by "Vincent Drabbe" <vincent@w...> on Tue, 3 Apr 2001 16:26:10 +0200
You forgot the closing ) of the VALUES !!!





----- Original Message -----

From: "Jake C" <jakeone@b...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, April 04, 2001 4:17 AM

Subject: [asp_databases] Incorrect syntax near keyword 'WHERE'





> Hi there,

>

> I keep getting an error, "Incorrect syntax near the keyword 'WHERE'".  My

> code reads as follows:

>

> objRS.Open "INSERT INTO Contacts(CompWebsite,CompLogo," &_

> "CompName,ContactFName,ContactLName," &_

> "ContactWorkTel,ContactMobileTel,ContactEmail," &_

> "ContactFax,ContactAddress1,ContactAddress2," &_

> "ContactTown,ContactCounty)" &_

> " VALUES('" & CompWebSite & "','" & CompLogo & "','" & CompName & "'," &_

> "'" & ContactFName & "','" & ContactLName & "'," &_

> "'" & ContactWorkTel & "','" & ContactMobileTel & "'," &_

> "'" & ContactEmail & "','" & ContactFax & "'," &_

> "'" & ContactAddress1 & "','" & ContactAddress2 & "'," &_

> "'" & ContactTown & "','" & ContactCounty & "'," &_

> " WHERE loginID = '" & Session("loginID") & "'", Con, adOpenStatic,

> adLockOptimistic

>

> Can anyone spot what I'm doing wrong?  I've verified my connection is

> correctly setup, as is my session variable. Thanks for any help you can

> give.

> 
Message #4 by "Daniel O'Dorisio" <dodorisio@h...> on Tue, 3 Apr 2001 11:48:26 -0400
Maybe you want to use a UPDATE Statement



UPDATE bla SET foo = bla WHERE id=id



Daniel



-----Original Message-----

From: Blake, Shane [mailto:Shane.Blake@p...]

Sent: Tuesday, April 03, 2001 10:17 AM

To: ASP Databases

Subject: [asp_databases] RE: Incorrect syntax near keyword 'WHERE'





there is no WHERE in an INSERT...



shane



-----Original Message-----

From: Jake C [mailto:jakeone@b...]

Sent: Tuesday, April 03, 2001 10:18 PM

To: ASP Databases

Subject: [asp_databases] Incorrect syntax near keyword 'WHERE'





Hi there,



I keep getting an error, "Incorrect syntax near the keyword 'WHERE'".  My

code reads as follows:



objRS.Open "INSERT INTO Contacts(CompWebsite,CompLogo," &_

"CompName,ContactFName,ContactLName," &_

"ContactWorkTel,ContactMobileTel,ContactEmail," &_

"ContactFax,ContactAddress1,ContactAddress2," &_

"ContactTown,ContactCounty)" &_

" VALUES('" & CompWebSite & "','" & CompLogo & "','" & CompName & "'," &_

"'" & ContactFName & "','" & ContactLName & "'," &_

"'" & ContactWorkTel & "','" & ContactMobileTel & "'," &_

"'" & ContactEmail & "','" & ContactFax & "'," &_

"'" & ContactAddress1 & "','" & ContactAddress2 & "'," &_

"'" & ContactTown & "','" & ContactCounty & "'," &_

" WHERE loginID = '" & Session("loginID") & "'", Con, adOpenStatic,

adLockOptimistic



Can anyone spot what I'm doing wrong?  I've verified my connection is

correctly setup, as is my session variable. Thanks for any help you can

give.



Message #5 by "Tomm Matthis" <matthis@b...> on Tue, 3 Apr 2001 13:07:10 -0400
You are appending the connectiona and cursor type information to the SQL 

string.

That is what it is complaing about.



-- Tomm



> -----Original Message-----

> From: Jake C [mailto:jakeone@b...]

> Sent: Tuesday, April 03, 2001 10:18 PM

> To: ASP Databases

> Subject: [asp_databases] Incorrect syntax near keyword 'WHERE'

>

>

> Hi there,

>

> I keep getting an error, "Incorrect syntax near the keyword 'WHERE'".  

My

> code reads as follows:

>

> objRS.Open "INSERT INTO Contacts(CompWebsite,CompLogo," &_

> "CompName,ContactFName,ContactLName," &_

> "ContactWorkTel,ContactMobileTel,ContactEmail," &_

> "ContactFax,ContactAddress1,ContactAddress2," &_

> "ContactTown,ContactCounty)" &_

> " VALUES('" & CompWebSite & "','" & CompLogo & "','" & CompName & "'," 

&_

> "'" & ContactFName & "','" & ContactLName & "'," &_

> "'" & ContactWorkTel & "','" & ContactMobileTel & "'," &_

> "'" & ContactEmail & "','" & ContactFax & "'," &_

> "'" & ContactAddress1 & "','" & ContactAddress2 & "'," &_

> "'" & ContactTown & "','" & ContactCounty & "'," &_

> " WHERE loginID =3D '" & Session("loginID") & "'", Con, adOpenStatic,

> adLockOptimistic

>



Message #6 by "John K. King" <johnking@o...> on Tue, 03 Apr 2001 14:20:05 -0700
Hi Jake:



Looks like you may be missing the closing paren for the VALUES. Probably 

need it in the following line:



"'" & ContactTown & "','" & ContactCounty & "')," &_



JK





At 03:17 AM 4/4/01 +0100, Jake C wrote:

>Hi there,

>

>I keep getting an error, "Incorrect syntax near the keyword 'WHERE'".  My

>code reads as follows:

>

>objRS.Open "INSERT INTO Contacts(CompWebsite,CompLogo," &_

>"CompName,ContactFName,ContactLName," &_

>"ContactWorkTel,ContactMobileTel,ContactEmail," &_

>"ContactFax,ContactAddress1,ContactAddress2," &_

>"ContactTown,ContactCounty)" &_

>" VALUES('" & CompWebSite & "','" & CompLogo & "','" & CompName & "'," &_

>"'" & ContactFName & "','" & ContactLName & "'," &_

>"'" & ContactWorkTel & "','" & ContactMobileTel & "'," &_

>"'" & ContactEmail & "','" & ContactFax & "'," &_

>"'" & ContactAddress1 & "','" & ContactAddress2 & "'," &_

>"'" & ContactTown & "','" & ContactCounty & "'," &_

>" WHERE loginID = '" & Session("loginID") & "'", Con, adOpenStatic,

>adLockOptimistic

>

>Can anyone spot what I'm doing wrong?  I've verified my connection is

>correctly setup, as is my session variable. Thanks for any help you can

>give.

>

  Return to Index