MS SQL 6.5 and VBScript question
by "Dahlstrom, Marie" <marie.dahlstrom(at)se.unisys.com>
|
| Date: |
Wed, 17 May 2000 05:13:48 -0500 |
| To: |
"Hwg-Languages@Hwg. Org (E-mail)" <hwg-languages(at)hwg.org> |
| |
todo: View
Thread,
Original
|
|
Hello list,
I'm trying to get a VB Script to work with a simple enough SQL statement,
i've have been trying different solutions but I do not have any more
suggestions on how to solve this.
Scope.
I have three tables in the SQL database which are "joined" with a Foreign
Key. I would like to achive the following.
1. Getting a search result (with a record set)
2. From this record set choose one of the records and delete it, every
instance in each of the three tables.
I am using the following code to achive this:
id=Request.Form("id")
if request.form("id")<>"" then
x= "delete from TABLE1.id, TABLE1.kolumn2, TABLE1.kolumn3, TABLE2.id,
TABLE2.kolumn3 WHERE id= '" &id& "' And TABLE1.id=TABLE2.id "
set rs=conn.Execute(x)
end if
The error message is Incorrect syntax near ','.
If I only do this on one table i.e
x= "delete from TABLE1 WHERE id= '" &id& "' "
it works...
id = The Foreign Key and Primary Key in the main table.
I'm using a similar code for inserting in the same tables, where it works.
Any hints are welcome.
Regards
Marie
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.