Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2004, 12:36 AM
Authorized User
 
Join Date: Apr 2004
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default delete record error

I'm receiving the following error message:

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Line 1: Incorrect syntax near ','.
/mysite/delete.asp, line 121

This error is thrown when only after I delete or update a record a second time. When I delete or update a record the first time it works, but when I try to delete or update a record a second time the above error is thrown? I can close the browser down and it will work the first-time and throw the error on the second attempt again.

I did some error checking and found that when I attempted to delete a record a second time I received the following with the error checking code:

SELECT * FROM dbo.tblLogin WHERE LoginID = 30, 29

The first time, I deleted the record with loginID of 30 then the second time I tried to delete the record with loginID of 29.

So, is the new login value concatenating to the existing string? Is that the problem? I thought that if I it was concatenating to the existing string it would display 3029? But the statement should only read:

SELECT * FROM dbo.tblLogin WHERE LoginID = 29

I was looking at my admin.asp page and think the problem could be related to the looping statements on line 293 or 301? I'm not sure?

I'm using the default update and delete server behaviors within DMX. I pass in the LoginID in the URL string.

I am at a loss here? Has anyone encountered this before or know how to correct this error?

Here is the code to both pages:

www.dwayneepps.com/download.htm

Any help would be greatly appreciated. Thanks
-Dman100-


 
Old September 10th, 2004, 10:40 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

What is on line 121? can you post that code?

Does this help? Construct the query as below.

SELECT * FROM dbo.tblLogin WHERE LoginID in ( 30, 29 )

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old September 11th, 2004, 07:57 PM
Authorized User
 
Join Date: Apr 2004
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Vijay,

I was able to resolve the problem. Apparently, Dreamweaver preserves the querystring on redirects. So, that's why I had two values in the URL string when I tried to update or delete a second record. So, how I corrected the problem was by redirecting to a blank page with the update and delete server behaviors within Dreamweaver. Then on the blank page, I used a redirect back to the original page without the querystring value attached. Worked perfectly.

I did run into another problem, which I posted as another topic "querystring problem". I've been struggling with that one for several days and can't figure it out. If you have any help on that, I would be greatly appreciative.
Thanks.
-Dman100-






Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
Delete a record row, not just the record. Coby Access VBA 1 April 30th, 2007 06:29 AM
Trying to delete a record... Can't do it... lguzman Access VBA 11 August 13th, 2004 12:41 PM
Can't delete record Trojan_uk SQL Server 2000 3 November 27th, 2003 01:03 PM
Delete record but how? scifo Beginning PHP 3 August 1st, 2003 12:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.