Results 1 to 2 of 2

Thread: what could be the Problem? -SQL

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Nairobi- kenya
    Posts
    13

    what could be the Problem? -SQL

    I want to delete records that are returned By a variable- prompt
    I have this code under a procedure -CancelReservations:

    Dim rec As New ADODB.Recordset
    Dim Mysql As String
    Mysql = "DELETE Accounts.*,Reservations.* "
    Mysql = Mysql & "FROM accounts,reservations "
    Mysql = Mysql & "WHERE reservations.Name
    IN (" & prompt & ")"
    Set rec = Cnca.Execute(Mysql)
    I am getting the following error:

    "Record is deleted"

    how can I Avoid this error? any ideas?
    hos
    hoss

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    hmmm...

    One idea :

    I take it this is from a button on a form.
    Enter the name into a text field.
    .
    It would be something like the following

    '--------------------
    dim adocmd as new adodb.command

    on error resume next

    adocmd.sql="delete Accounts.* from Accounts where accounts.name='" & txtFieldName & "';"
    adoCmd.execute

    adocmd.sql="delete reservation.* from reservations where reservations.name='" & txtFieldName & "';"
    adoCmd.execute

    set adocmd=nothing
    '--------------------

    I haven't done much with ado - so I can't remember the exact properties you need to fill in, but this should be close...

    Experiment ?

    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width