Results 1 to 2 of 2

Thread: can somone see what im doing wrong here please ??

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Location
    England, Bedfordshire
    Posts
    112

    can somone see what im doing wrong here please ??

    What im trying to to do is update an existing record in the database with the contents form the txtboxes into the felids shown.

    'open connection with database'
    deDatabase.rscomLock.Open

    Dim strSelected_Record As Integer
    strSelected_Record = frmRoadStaff.lstLock.SelectedItem.SubItems(6)

    strSQL = "UPDATE FROM Mechanics WHERE UniqueID=" & strSelected_Record
    deDatabase.rscomLock("Ref") = txtArea.Text
    deDatabase.rscomLock("Name") = txtLockName.Text
    deDatabase.rscomLock("Address") = txtAddress.Text
    deDatabase.rscomLock("Tel_Home") = txtHomeNo.Text
    deDatabase.rscomLock("Tel_Mobile") = txtMobileNo.Text
    deDatabase.rscomLock("Notes") = txtNotes.Text
    deDatabase.Connections(1).Execute strSQL

    Oh yeh and a quick Ps

    After you have made changes to a databse which is viewd from a listview, whats the listview command to REFRESH the list form the database?
    So Many things to do.....
    So little enthusiasm to do them.

  2. #2
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727
    shouldnt your sql string be:


    Code:
    "UPDATE TableName set Mechanics WHERE UniqueID=" & strSelected_Record

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