I have an Acces database classical ASP. In this db I have 2 tables. I am not
really a ASP programmer but with the help of example-scripts I succeeded in
functioning the whole thing. Recently I added a third table and now I have
the problem that I cannot delete records from it. I can delete records from
table 1 and 2 . For the deleting of records from table 3 I used the script
of the page for deleting the records from table one and two. I changed it a
little but it did not functtion. Can someone tell me what is wrong with it.
Situation:
Table 1 "Products" with many field, Field Pnr=prim key (autonumber)
Table 2 "Keyws" with 2 fields, Pnr = prim sleutel (number)
There is a relation between the tables (ref integrity)
The new table "Members" is independent from the other tables.The first
field is Member = prim key. All fields in this table are Text-type
The "ACTIONPAGE" (for deleting records from table 1 and 2)
<BODY>
<%
Dim strID
strID=Request.Form("Pnr")
DIM Conn
Set Conn=Server.CreateObject("ADODB.connection")
Conn.Open "DSN=x"
strSQL = "DELETE FROM Keyws WHERE Pnr=" & CLng(strID)
Conn.Execute(strSQL)
strSQL = "DELETE FROM Products WHERE Pnr=" & CLng(strID)
Conn.Execute(strSQL)
Conn.Close
Set Conn = Nothing
%>
<H2>The record has been deleted (I hope)</H2>
</BODY>
The "CHANGED ACTIONPAGE" (for deleting records from table 3)
<BODY>
<%
Dim strID
strID=Request.Form("Member")
DIM Conn
Set Conn=Server.CreateObject("ADODB.connection")
Conn.Open "DSN=x"
strSQL = "DELETE FROM Members WHERE Member=" & CLng(strID)
Conn.Execute(strSQL)
Conn.Close
Set Conn = Nothing
%>
<H2>The record has been deleted (I hope)</H2>
</BODY>
When I try this page I get the message Datatypes do not match in Criteria
expressions. The message refers to the line wich starts with strSQL = ....
I tried other scripts from the internet but did not succeed. Can someone
tell me what is wrong with mine.
Thanks in advance,
Marcel
