Results 1 to 8 of 8

Thread: Execute SQL commands

Threaded View

  1. #1

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Question Execute SQL commands

    I have the following code.
    VB Code:
    1. 'Set SQL statements
    2.         With daStaff
    3.             .DeleteCommand.CommandText = "DELETE FROM Staff" 'Delete statement
    4.             .InsertCommand.CommandText = "INSERT INTO Staff" 'Insert statement
    5.             .UpdateCommand.CommandText = SQLUpdateStr 'Update statement
    6.         End With
    How would i execute the "Delete, Insert or Update' CommandText?

    When i am in the code window i see .ExecuteNonQuery, .ExecuteReader and .ExecuteScalar when i type daStaff.UpdateCommand. in the dropdown list. Which one, if any would i use?
    Last edited by x-ice; Jun 29th, 2005 at 08:38 PM.

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