|
-
Sep 12th, 2001, 11:08 AM
#1
Thread Starter
New Member
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
-
Sep 12th, 2001, 06:47 PM
#2
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
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|