473,486 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Delete Multipul value from database

Fary4u
273 Contributor
Hi

is any body find out where is the problem is ?

i've got product value in 2 different tables it's remove from 1st table but how can i remove it from 2nd table

PROBLEM IN LINE 23

code is here
Expand|Select|Wrap|Line Numbers
  1. <%
  2. dim ors,ocon
  3. set ocon = server.createobject("ADODB.Connection")
  4. ocon.open ConString
  5. set ors = server.createobject("ADODB.RecordSet")
  6. dim a
  7. a= Trim(request("nam"))
  8. ors.open "select * from products where productID=" & a,ocon,adOpenDynamic,adLockOptimistic
  9.     if (a = "") then
  10.         response.redirect "admin.asp"
  11.     end if
  12.  
  13.     if ors.eof then
  14.         response.write" <p align=center><b><font face=Verdana color=#800000><br><br><br>Sorry there is no Record in database</font></b></p> "
  15.     else
  16.         ors.delete
  17.         ors.update
  18.  
  19.         dim orscol,oconcol
  20.         set oconcol = server.createobject("ADODB.Connection")
  21.         oconcol.open ConString
  22.         set orscol = server.createobject("ADODB.RecordSet")
  23.             orscol.open "select * from PRODUCT_SIZES where prod_id=" & a,oconcol,adOpenDynamic,adLockOptimistic
  24.  
  25.                 if ors.eof then
  26.                     response.write"Sorry"
  27.                 else
  28.                     response.write "ok"
  29.                     orscol.delete
  30.                     orscol.update
  31.                 end if
  32.  
  33.         orscol.close
  34.         set orscol=Nothing
  35.         oconcol.close
  36.         set oconcol=Nothing
  37.  
  38.         response.write" <p align=center><b><font face=Verdana color=#800000><br><br><br>Your Record has been Deleted from the database successfully</font></b></p> "
  39.         response.write" <p align=center><form action='index.asp'><input type='submit' value='Go Back'></form></p>"
  40.     end if
  41. ors.close
  42. set ors=Nothing
  43. ocon.close
  44. set ocon=Nothing
  45. %>
Feb 18 '08 #1
3 1341
DrBunchman
979 Recognized Expert Contributor
Hi there,

What's happening when you run this? Is it erroring or is it just not deleting the second recordset as you would expect it to?

Dr B
Feb 19 '08 #2
Fary4u
273 Contributor
i just need to deleted record from 2nd table it's doesn't do any ting
Feb 19 '08 #3
DrBunchman
979 Recognized Expert Contributor
I think it's just a typo. Check out line 25 - shouldn't it say:

"if oRSCol.EOF Then" rather than "if oRS.EOF" ??

It's checking the previous recordset rather than the one you've just opened. Give it a try and let me know how you get on.

Hope this helps,

Dr B
Feb 19 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
8853
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
9
10603
by: Robert Schneider | last post by:
Hi to all, I don't understand that: I try to delete a record via JDBC. But I always get the error SQL7008 with the error code 3. It seems that this has something to do with journaling, since the...
6
2010
by: Mark Kurten | last post by:
for some reason when i delete a row, the row doesn't get deleted from the acutal data table in SQL server. my code follows what am i missing? thanks. Dim row As DataRow Try
4
1353
by: trogenone | last post by:
I have entered this thread before but i am still having problems can anybody help? Im running access2003 and building a simple database. The tables im interested in are: And I have a...
2
1051
by: basanisoft | last post by:
Hi, Is Multipul Inheritance possiable in .Net if it possable how to do.
3
3409
by: bluez | last post by:
I want to design a webpage where user can search the data from the database and list out the related records. Each of the record got a delete button which allow user to delete the record. ...
13
1842
by: mac | last post by:
hi all, im creating a form wich wil upload images to a folder and their names and other details to a database. im able to do uploading but my delete function is not working, please can anybody...
0
1960
by: Slickuser | last post by:
From my PHP page: Grab all data from the database. Go through a loop to generate the HTML. Client side: From the Color drop menu list, if a user change the value. It will grab that value &...
1
4100
by: ahilar12 | last post by:
Hi all, I am new to php,my question is that in this following code i am retrieving many rows from the database which is working good.i want to delete a particular row(s) which is checked(checkbox)...
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7319
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.