how can i delete a recordset?

Results 1 to 2 of 2

Thread: how can i delete a recordset?

  1. #1
    newtoo Guest

    Default how can i delete a recordset?

    I want to be able to delete a record by it have both the first and last name match.<BR>like so<BR>sqlstmt = Delete from empl_Info where FirstName= firstname and LastName = lastname<BR><BR>i&#039m not sure of the exact syntax and i only want to delete if these two things match

  2. #2
    Joel N Guest

    Default RE: how can i delete a recordset?

    sqlstmt = "DELETE FROM empl_Info WHERE FirstName = &#039" & firstname & "&#039 AND LastName = &#039" & lastname & "&#039"<BR><BR>Watch the single-quote/double-quotes carefully. It&#039s hard to distinguish single/double quote combinations in messages on the board.<BR><BR>The literal values you want to match up MUST be in single quotes inside the string.<BR><BR>A hard-coded sql statement would look like this;<BR><BR>"DELETE FROM empl_Info WHERE FirstName = &#039John&#039 AND LastName = &#039Smith&#039"<BR><BR>Of course if you have more than one John Smith then ALL of them would be deleted with this statement. To be safe you&#039ll want the Primary Key on that table to be part of the WHERE clause so you only blast the specific record you want deleted.<BR><BR>HTH<BR>

Posting Permissions

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