473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Delete data from three tables

229 100+
Hi, I have this that works fine.


Expand|Select|Wrap|Line Numbers
  1.     dim strSQLDeleteWatch
  2.     strSQLDeleteWatch = "Delete from tblWatches where WatchedProfileID = " & rsProfiles("ProfileID")
  3.     objConn.Execute strSQLDeleteWatch
  4.  
  5.             rsProfiles.movenext
  6.         wend
  7.  
  8.     strSQLDeleteWatch = "Delete from tblWatches where WatchingUserID = " & intOptionsAndInfoUserIdDelete
  9.     objConn.Execute strSQLDeleteWatch
  10.  
  11.         rsProfiles.close
  12.         set rsProfiles = Nothing



I need to delete other associated data like.


Expand|Select|Wrap|Line Numbers
  1. 'dim strSQLDeletelink
  2.     'strSQLDeletelink = "Delete from tblLinkTrackerLogs where link_id = " & rsProfiles("ProfileID")
  3.     'objConn.Execute strSQLDeletelink
I cannot see where I need to include it with the wend that is currently there. Any pointers would be great.
Thanks in advance.
Richard
May 22 '13 #1
2 1436
Rabbit
12,516 Expert Mod 8TB
We don't know either, you haven't told us how it's related so it's difficult to say how to delete the relation.
May 22 '13 #2
fran7
229 100+
Hi, thanks for the reply.

Looks like i solved it by adding the other delete above the two connected by wend


Expand|Select|Wrap|Line Numbers
  1.     dim strSQLDeletelink
  2.     strSQLDeletelink = "Delete from tblLinkTrackerLogs where link_id = " & rsProfiles("ProfileID") 
  3.     objConn.Execute strSQLDeletelink    
  4.  
  5.  
  6.    dim strSQLDeleteWatch
  7.     strSQLDeleteWatch = "Delete from tblWatches where WatchedProfileID = " & rsProfiles("ProfileID")
  8.     objConn.Execute strSQLDeleteWatch
  9.  
  10.             rsProfiles.movenext
  11.         wend
  12.  
  13.  
Thanks
Richard
May 25 '13 #3

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

Similar topics

5
by: EMW | last post by:
Hi, I have an Oracle database with different tables of data. They all have one common field. I need to combine some fields from three tables. i.e. field1 and field2 from table1 field3 and...
0
by: WindAndWaves | last post by:
Hi Gurus Here is another question that I have been struggling with for over a year. Basically, I would like to allow users to enter data into three tables in at the same time. The reason it...
16
by: Andy_Khosravi | last post by:
I'm in a bit of a pickle. My employer, a health insurance firm, had me design a small database to track benefit issues. The intended users were technical specialists and some managers (about 90...
1
by: yasinahmad | last post by:
Hi every one I have three tables 1-students 2-books 3-pens I wont to make report by data report to show tables like this student name
6
by: John | last post by:
Hi I have three tables with a common id with which they can be linked. I need to merge them in a way that the resultant table has all records from three tables. Below is what sort of result I am...
7
by: cov | last post by:
I have a php query where I'm attempting to pull data from 3 different tables between a php form and mysql db. I had hoped early on to use a unique identifier to help ensure referential integrity...
1
by: doc1355 | last post by:
I have a feeling that this is an easy question. However I'm a newbee and don't have any idea how to do this. I have three tables that stores my users information. Each user has a unique ID that is...
0
by: ShirishKumar | last post by:
I have three tables 1) Country - columns (PKCountryId(PrimaryKey),CountryName) 2)State - Columns (PKStateId(PrimaryKey),StateName,FKCountryId(ForeignKey)) 3)Address Details...
1
by: Big X | last post by:
I have already achieved this in access and was trying with straight SQL earlier I would just like to know what I'm doing wrong in sql or what syntax I'm missing. I have three tables with identical...
1
by: anna brown | last post by:
hi there, i have three tables with independent data. example: table 1: red, white, green, .... table 2: big, small, large, .... table 3: Mary, Adam, John, ... I need to create a form with...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.