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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top