Delete button to remove corresponding row in sql server 2005 in asp apge not working


hi ,

I would be really grateful if you could help me. actually i have got a table in asp page which each row having a delete button.when i click the button the corresponding row in the sql server mudt be deleted. pleas find some of my codes below

Server.ScriptTimeout = 7200
if request.form("btnDel") = "Del" then

call DelRow()

end if

sub Delrow()

dim sql
dim record


sql = "DELETE FROM Q_table WHERE QCode='" &Request.Form("txtQCode")


set record = Server.CreateObject("adodb.recordset")

set record = con.Execute(sql)

end sub

sub LtQu()
str = "SELECT QCode,QTitle,A.ABody,Date,ExpiryDate " & _
" FROM Q_table as QM INNER JOIN ABody as A ON A.ABodyC = QM.Abody "

set record = Server.CreateObject("adodb.recordset")
set record = con.Execute(str)
RecCount = 1
do while not record.eof






'str = str & " & "" & "^"
str = str & & "" & "^"


'str = str & "^" & "" & "^"



end sub



Posted On: Wednesday 24th of October 2012 12:52:08 AM Total Views:  364
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




Can't delete the record.

. I was trying to make a asp page to erase the record file. But it's running at the begining but when i check it to the database the data still there. I still trying to find the problem but i couldn't. The question is : Why it happen, and which one from the script that cause that problem.. Here is the firs script Code: :: Administrator Area :: A:hover {color:#FF7300;} A { text-decoration: none; color:000000; font-size: 10; font-family: verdana; font:900; } TD{ FONT-SIZE:11; FONT-FAMILY:verdana; COLOR:000000; } input{ FONT-SIZE:11; FONT-FAMILY:verdana; COLOR:000000; } font.bold{font:900;color:ffffff} font.right{color:ffffff} font.left{font-size:12} .style1 {color: #33FFFF} .style3 {color: #999999} .style8 {font-size: 10px} .style9 {font-size: 10}           id Password Nama Nama Belakang Alamat Kota Negara No.Telepon Email Kode Pos Fax     Cari    Hapus   Update Powered by : Pancasona Technology      ::: Pancasona I :: Jln. Jamin ginting no.309 Padang bulan Medan Telp. : (061)844777 Fax : (061) 8555444 Email : support@pancasona.com :: Pancasona II :: Jln. Jamin ginting no. 109 Padang bulan Medan Telp. : (061)844777 Fax : (061) 8555444 :: Pancasona III :: Jln. Tanjung sari no. 290 Padang bulan Medan Telp. : (061)884322 HOME    ABOUT US    PRODUCT    GALLERY    ADMIN    HELP Copyright 2007 Pancasona.com Inc. rights reserved. and this is the second : Code: Untitled Document data telah terhapus =========== Error Type: Microsoft JET Database Engine (0x80040E14) Syntax error in UPDATE statement. /TA/leve/leve/html/updatesuccess.asp, line 15 update ------------- :: Administrator Area :: A:hover {color:#FF7300;} A { text-decoration: none; color:000000; font-size: 10; font-family: verdana; font:900; } TD{ FONT-SIZE:11; FONT-FAMILY:verdana; COLOR:000000; } input{ FONT-SIZE:11; FONT-FAMILY:verdana; COLOR:000000; } font.bold{font:900;color:ffffff} font.right{color:ffffff} font.left{font-size:12} .style1 {color: #33FFFF} .style3 {color: #999999} .style8 {font-size: 10px} .style9 {font-size: 10}             id Password Nama Nama Belakang Alamat Kota Negara No.Telepon Email Kode Pos Fax       Data Baru Pengganti Data yang Lama Password Nama Nama Belakang alamat kota Negara No.Telepon Email Kode pos Fax     Cari    Hapus   Update Powered by : Pancasona Technology      ::: Pancasona I :: Jln. Jamin ginting no.309 Padang bulan Medan Telp. : (061)844777 Fax : (061) 8555444 Email : support@pancasona.com :: Pancasona II :: Jln. Jamin ginting no. 109 Padang bulan Medan Telp. : (061)844777 Fax : (061) 8555444 :: Pancasona III :: Jln. Tanjung sari no. 290 Padang bulan Medan Telp. : (061)884322 HOME    ABOUT US    PRODUCT    GALLERY    ADMIN    HELP Copyright 2007 Pancasona.coma rights reserved.
VIEWS ON THIS POST

242

Posted on:

Friday 26th October 2012
View Replies!

Auto delete record after certain time?

all, I'm trying to build a web page that will automatically delete records (in Access 2k) after a certain amount of time. I need to delete records that are older than a month of the current date. I've searched all over the internet trying to find examples of how to do this and the few that I've found don't seem to work for me. Does anyone have an example that works Either using an sql query or programmatically. I'm using Classic ASP (VBScript).
VIEWS ON THIS POST

315

Posted on:

Friday 26th October 2012
View Replies!

Problem with delete

hi there: I am having query in my program which deletes a record.Following is the query which gets activated if you press the delete button.. if request.form("delete")"" then de="Delete * from login where FirstName='"&request.querystring("FirstName")&"'" objConn.Execute(de) response.write "Record deleted.Please close the window and refresh the main window" end if this is the error which i am getting: Error Type: Microsoft JET Database Engine (0x80020009) Record is deleted. /changelogin.asp funny part is that the record is getting delted but it displays this message on the screen which i dont want to.. please help!
VIEWS ON THIS POST

217

Posted on:

Friday 26th October 2012
View Replies!

Insert,Update,delete data from a table

I have created a page and passing the tablename and values of the field to another page using post method. now on this page i have accepted the values but i dont know how to insert these into the table. i have done this so far. Code: sql ="Insert into"& tablename sql = sql & "(" sql = sql & "Day,Time,Location,Checkpoint_Details" sql = sql & ")" sql = sql & "Values" sql = sql & "(" sql = sql & "& day , & time , & location , & details" sql = sql & ")" Set RS = conn.Execute( sql ) note that day,time,location,details and tablename are variables. socan anyone help.
VIEWS ON THIS POST

261

Posted on:

Friday 26th October 2012
View Replies!

HELP! edit and delete

anyone in here got an idea how i can edit and delete records
VIEWS ON THIS POST

245

Posted on:

Friday 26th October 2012
View Replies!

ASP multiple update/delete in 1 table

how can i do multiple delete/update in 1 table like the shoping cart. because my code have error. hope someone can help me to settle the problem thanks you. below is my source code: TT // When the value in a textfield is changed, notice the onChange="RecUpdate('')" // on each of the textfields, the value of the Record ID associated with that field // is passed to the RecUpdate function. First the value is surounded with 2 asterisks e.g. *6* // This is so that *1* can be distinguished from *10*, *11* etc. function RecUpdate(id){ var ThisID = "*" + (id) + "*" if (document.form1.hidRecIDs.value == ""){ // If the hidden field is empty document.form1.hidRecIDs.value = (ThisID) // Store the value in the hidden field (hidRecIDs) as it is. } if (document.form1.hidRecIDs.value != ""){ // If the hidden field isn't empty var str = document.form1.hidRecIDs.value; // Store the contents of the hidden field in the variable str var pos = str.indexOf(ThisID); // Search str to see if this RecID is allready in it. if (pos == -1) { // If the position returned is -1 it isn't allredy in there, document.form1.hidRecIDs.value = document.form1.hidRecIDs.value + ", " + (ThisID) } // so add ", " and this ID to what is already in hidRecIDs } // to create a list like this *2*, *5*, *8* etc. }    
VIEWS ON THIS POST

241

Posted on:

Friday 26th October 2012
View Replies!

Either BOF or EOF is True, or the current record has been deleted. Requested operatio

I have a code here with 2 if conditions... they work separately but if i put htem together i get this error when i click the remove from family button... i know this code is big but then error is in second part of the if statement... i know this may be an error in the logic... ples help me this is real urgent this is the code         &n bsp;        Parts associated with other families Family Name Part Number and this is the error i am getting... Error Type: ADODB.Field (0x80020009) Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. /updatefamily.asp sorry ... this is real urgent and i am no good programmer to debug this... thanx Brat
VIEWS ON THIS POST

226

Posted on:

Friday 26th October 2012
View Replies!

Help - delete record

I'm sure there's a fairly easy answer to this (all you ASP gurus). I'm simply trying to check if the categoryid is currently being used by any catalogue/product items. Ok, I've created a mini site content management system and I'm stuck on this function that will ensure data integrity... I'm trying to check if the categoryid I'm trying to delete has any related 'catalogue' items (products); and if so display a message 'Sorry, there are items currently listed under this category. Move the items before trying to delete'. Basically disallow the delete function if any catalogue items share the categoryid. That's it! Simple... right\t Code: Catalogue Categories Simply select an item to edit. Check the delete box and then select 'submit' to delete. To add a new category click here. Category Name Edit Delete Edit ID No.
VIEWS ON THIS POST

230

Posted on:

Friday 26th October 2012
View Replies!

Best way to delete a certain line from file?

I have a file in a format like this that holds records (month, day, year, and event name on that date): 4|||12|||2005|||Spring Fling 4|||19|||2005|||Kappa Eta Meeting Scheduled 4|||21|||2005|||Some Event 4|||22|||2005|||Another EventOn a form, it shows up as follows, and the user selects which date they want to delete: Spring Fling Kappa Eta Meeting Scheduled Some Event Another EventSo, for example, let's say that the user selected "Some Event." If so, then the file should then be as follows: 4|||12|||2005|||Spring Fling 4|||19|||2005|||Kappa Eta Meeting Scheduled 4|||22|||2005|||Another EventI have some code that gets the job done, but it ends up adding a bunch of unnecessary blank lines and whatnot. I've tried for weeks to get it working, and rather than showing you my messy code, I was wondering if anybody knew a good way to get this done off the top of their heads.
VIEWS ON THIS POST

296

Posted on:

Friday 26th October 2012
View Replies!

Compressing arrays after having deleted one of the middle posts?

I have an array that I can increase and delete records from by clicking on objects on the screen. Now I wonder how I can compress the array after I have deleted a record from the middle of the array. I have this code which I guess moves the empty record to the last spot in the array. However, when the counter "i" reaches the last position in the array "i+1" that causes an "out of range" problem. How can I solve this At last, when I know that the last post in the array is empty I redim the array and thus removes that post completely. Well, I hope you understand what my problem is and have a nice solution to it.
VIEWS ON THIS POST

290

Posted on:

Friday 26th October 2012
View Replies!

delete file from server

what r things that I have to do to let the client browser to delete a file on the server... I'm running my server on WIN2000 pro, IIS 5.0 I've stored my website and server in a virtual directory.. This is the code i use to delete a file from the server folder Code: Function delete_file(exceldb) '***************** Delete********************** Set fso = CreateObject("Scripting.FileSystemObject") Set fileObject = fso.GetFile(Server.MapPath("..\upload2\uploads\"& exceldb)) fileObject.Delete Set fileObject = Nothing Set fso = Nothing ' Deletes exceldb End Function please do help... thanx a lot
VIEWS ON THIS POST

244

Posted on:

Friday 26th October 2012
View Replies!

Dreamweaver delete record problem

hi, im trying to add the delete record behaviour with dreamweaver. iv set up all the text fields and the recordsets but when the behaviour is generated the error "the original recordset in the script was not found". i have the add record server behaviour working, but this is not any help wud be great
VIEWS ON THIS POST

222

Posted on:

Friday 26th October 2012
View Replies!

Write to file on server->user downloads->file is deleted??

Ok, here's a complicated issue: I have an VB ASP page that creates, using a linked database, ad-hoc queries. Like, the user selects what table to look into, what fields, any criterias (ex: PROVINCE="QC"), etc. That part is easy. The problem is, I would like the results to be outputted in MS EXCEL. Well, it's not my idea, but I have to do it. Any ideas how this can be done My only idea would be that: 1) The ASP page writes to a file on the server and offer a link to the user to download that file. 2) User Downloads 3) We can't have these Excel files cluttering up the server, so the file would also have to be deleted automatically. Is this even remotely possible I'm not too good with ASP, so is it even possible to write to file Could I create a Workbook/worksheet object using VB ASP Can I delete the file programatically Thank you for any help **EDIT: Ok, yes I can create an Excel Sheet. Now I have to figure out how to save it without knowing the drive name. So that leaves me with: Can I delete the file after I'm done with it** **Edit2: Problem solved** , Originally Posted by OGT Ok, here's a complicated issue: I have an VB ASP page that creates, using a linked database, ad-hoc queries. Like, the user selects what table to look into, what fields, any criterias (ex: PROVINCE="QC"), etc. That part is easy. The problem is, I would like the results to be outputted in MS EXCEL. Well, it's not my idea, but I have to do it. Any ideas how this can be done My only idea would be that: 1) The ASP page writes to a file on the server and offer a link to the user to download that file. 2) User Downloads 3) We can't have these Excel files cluttering up the server, so the file would also have to be deleted automatically. Is this even remotely possible I'm not too good with ASP, so is it even possible to write to file Could I create a Workbook/worksheet object using VB ASP Can I delete the file programatically Thank you for any help **EDIT: Ok, yes I can create an Excel Sheet. Now I have to figure out how to save it without knowing the drive name. So that leaves me with: Can I delete the file after I'm done with it** You can delete a file programmatically using the File System Object: Code: However, you might delete the file before the user gets to it. To work around this you could add a date stamp to the filename and cleanup anything over 48 hours old using another script
VIEWS ON THIS POST

242

Posted on:

Friday 26th October 2012
View Replies!

Either BOF or EOF is True, or the current record has been deleted

Please have a look at this code. I am hoping someone with a keen eye can spot my error. It says I have 8 records but is not displaying them. Error: ADODB.Fielderror '800a0bcd' Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. /deleteevent.asp, line 33
VIEWS ON THIS POST

239

Posted on:

Friday 26th October 2012
View Replies!

edit and delete from a table

, I have a table which views fields from database to users. I have the edit and delete links in each row. My question is how do I get the id of the row in the url to use in the action page Thank you.
VIEWS ON THIS POST

162

Posted on:

Friday 26th October 2012
View Replies!

How to delete a row from a multidimensional (2 x i) array

I've got a 2xi dynamically sized array. Anyway, I'm trying to come up with a method of deleting a single row of the array. I can't find or think of any command that will do this automatically, but it seems that the only other option is to copy the array, row by row, to a new array. There would be an if statement regulating the copying - it would flag the row containing the element I want removed and just not copy it. But I'm certain that there's a cleaner method of achieving this end... anyone know
VIEWS ON THIS POST

174

Posted on:

Friday 26th October 2012
View Replies!

Help me : view, update and delete excel sheet with asp

: I want to view, update and delete records from Excel Spreadsheet using ASP. I would appreciate if somebody could tell me where could I find some examples and tutorials to do this. Thank You
VIEWS ON THIS POST

316

Posted on:

Friday 26th October 2012
View Replies!

Arguements problems with select&delete

Basically im getting a record and deleteing it. this is the error im getting : Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another and here is the code: rs.Open "SELECT * FROM [Temporary] WHERE (Email=" & Email & ")", conn1, adopendynamic, adlockoptimistic, adcmdtext rs.delete rs.update rs.close Please reply if you have any suggestions
VIEWS ON THIS POST

249

Posted on:

Friday 26th October 2012
View Replies!

Either BOF or EOF is True, or the current record has been deleted

Howcome it doesn't work ADODB.Field error '80020009' Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. /gemetria/kjvresp3.asp, line 0 It was working before!!! Code: body { font-family : Verdana; font-size : 8pt; } a { font-family : Verdana; font-size : 8pt; text-decoration : none; }
VIEWS ON THIS POST

272

Posted on:

Friday 26th October 2012
View Replies!