Access db on web delete records

M

mettá

I am trying to delete records within a db on a web site and need help!

I have tried.....


<%Dim DSN_Name
DSN_Name = Application("dbpages_ConnectionString")
set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open DSN_Name
Set RSCat = Server.CreateObject("ADODB.RecordSet")
SQL = "DELETE DISTINCT from tPages WHERE idp=::idp:: and spage='::spage::'"
RSCat.Open SQL, Connection
RSCat.MoveNext
wend
RSCat.Close
%>

Can anyone tell me where I am going wrong as the above does not work?

Thanks
M
 
A

Adrienne Boswell

I am trying to delete records within a db on a web site and need help!

What db?
I have tried.....


<%Dim DSN_Name
DSN_Name = Application("dbpages_ConnectionString")
set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open DSN_Name
Set RSCat = Server.CreateObject("ADODB.RecordSet")
SQL = "DELETE DISTINCT from tPages WHERE idp=::idp:: and
spage='::spage::'" RSCat.Open SQL, Connection
RSCat.MoveNext
wend
RSCat.Close
%>

Can anyone tell me where I am going wrong as the above does not work?

What kind of error did you get? Although I know MySQL does not allow
DISTINCT in a DELETE statement - DISTINCT is for a SELECT statement.

Why are you creating a record set for a delete? It is not necessary,
again, you would need a record set only for a SELECT statement.
 
E

Evertjan.

Adrienne Boswell wrote on 18 sep 2009 in
microsoft.public.inetserver.asp.general:
What db?


What kind of error did you get? Although I know MySQL does not allow
DISTINCT in a DELETE statement - DISTINCT is for a SELECT statement.

and most if not all engines need:

DISTINCT something

meseeems
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top