Access db on web delete records

Discussion in 'ASP General' started by mettá, Sep 18, 2009.

  1. mettá

    mettá Guest

    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
    mettá, Sep 18, 2009
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed "mettá"
    <> writing in
    news:u0uIUp$:

    > 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.


    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Sep 18, 2009
    #2
    1. Advertising

  3. mettá

    Evertjan. Guest

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

    > Gazing into my crystal ball I observed "mettá"
    > <> writing in
    > news:u0uIUp$:
    >
    >> 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.


    and most if not all engines need:

    DISTINCT something

    meseeems

    > 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.
    >
    >




    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Sep 18, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mahesh Kumar
    Replies:
    1
    Views:
    1,030
    Steve C. Orr [MVP, MCSD]
    Oct 25, 2003
  2. Replies:
    3
    Views:
    7,765
    elizas
    Apr 27, 2010
  3. Luke Airig
    Replies:
    0
    Views:
    786
    Luke Airig
    Dec 31, 2003
  4. Dan

    Delete records or update records

    Dan, May 10, 2004, in forum: ASP General
    Replies:
    1
    Views:
    460
    Ray at
    May 10, 2004
  5. Replies:
    3
    Views:
    653
    Anthony Jones
    Nov 2, 2006
Loading...

Share This Page