View Full Version : Data records being randomly deleted from table
srajagop
November 28th, 2001, 11:33
Hello...
I'm facing a very unique problem in that, random if not all records from my database get deleted. I know that no one else has access to the database, or the asp page so it would be unlikely that someone would go thru and delete all records. I have a feeling, there's some bug in my asp code thats trigerring the delete operation. I am not sure which part of my asp code i should paste here for reference, but its quite straightforward... Open a DSN-less connection to an access db, and check to see what the user clicks, there are options to add a record, update existing ones or delete existing ones. Actions are performed accordingly.
Thanks...
Mikki00
November 28th, 2001, 17:48
Oh if only I could understand what you're talking about. :D But let me take a wild guess, could it be that a automatic program that clean your database? I heard it happened lots of time before, where it goes to other people database by accident rather than the one that program it. But then again....I have no idea what I just said. :p
srajagop
November 29th, 2001, 09:22
Well.. I thought the same, but I doubt if its something like that. But here's the delete section of my code.... if someone can see something unusual, please let me know, as far as I think it looks alright, but who knows.... thanks!!!
'If the QueryString has the Actionvar = del then del the item and generate an "Operation Complete" page'
ELSEIF Actionvar="del" THEN
SQLstmt2 = "INSERT INTO boardrmbkup SELECT CodecManufacturer,Model,CodecSWVersion,Vendor,VendorTechnica lContact,"
SQLstmt2 = SQLstmt2 & "VendorTechnicalPhone,
VendorSalesContact,VendorSalesPhone,MaintenanceContract
FROM boardroom WHERE ID=" & Request.QueryString("Recid")
conn.Execute(SQLstmt2)
SQLstmt = "DELETE * FROM boardroom WHERE ID=" & TRIM(Request.QueryString("Recid"))
conn.execute(SQLstmt)
Response.Write "Operation Complete<BR><A HREF=""Boardroom_Database.asp"">back</A>"
Cyber
November 29th, 2001, 10:50
SQLstmt = "DELETE * FROM boardroom WHERE ID=" & TRIM(Request.QueryString("Recid"))
i think thats the problem.
srajagop
November 29th, 2001, 11:14
Well... that statement is there if users wish to delete a particular record from the database, so I'm aware of that and I doubt if thats the problem. I mean I think there is some sort of a bug which triggers that statement to execute, unless someone thinks that the problem is somewehre else.
The problem I'm facing is - without initiating any action externally, a bunch of records get deleted, which is really baffling me.
Cyber
November 29th, 2001, 15:18
doesn't "DELETE *" mean delete all?
srajagop
November 29th, 2001, 16:23
Well... "DELETE * ..." means delete all fields for that particular record as it can be seen from my use of the WHERE clause... I've been testing the delete function and it works fine i.e. it only deletes the record that I choose and not all the records.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.