Results 1 to 3 of 3

Thread: Can't figure out the error

Threaded View

  1. #1

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

    Resolved Can't figure out the error

    VB Code:
    1. Dim SQLUpdateStr As String
    2. 'SQL Update string
    3. SQLUpdateStr = "UPDATE Staff SET Address = @Address, BookingRights = @BookRight," & _
    4. "Contract = @Contract, DOB = @DOB, Forename = @Forename, Gender = @Gender," & _
    5. "LoginRights = @LoginRight, ManageRights = @ManageRight, MemberRights = @MemberRight," & _
    6. "Position = @Position, Postcode = @Postcode, Salary = @Salary, StartDate = @StartDate," & _
    7. "Surname = @Surname, [Telephone Number] = @TelNum"
    8. [B]'Set SQL statements
    9. daStaff.DeleteCommand.CommandText = "DELETE FROM Staff" 'Delete statement
    10. daStaff.InsertCommand.CommandText = "INSERT INTO Staff" 'Insert statement
    11. daStaff.UpdateCommand.CommandText = SQLUpdateStr 'Update statement[/B]
    When i run this code i get an error ("Object reference not set to an instance of an object."). I don't know why this error is occuring, but i have found out that the error is in the code i highlighted in bold. Any ideas?
    Last edited by x-ice; Jun 5th, 2005 at 03:16 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