Results 1 to 5 of 5

Thread: [2005] Problem with SQL Update / Delete query

Threaded View

  1. #1

    Thread Starter
    Junior Member maco's Avatar
    Join Date
    Aug 2006
    Location
    Linköping, Sweden
    Posts
    20

    [2005] Problem with SQL Update / Delete query

    Hi!

    I'm using the following code to update my table, it reports no error but the data isnt being updated. I have no clue what I'm doing wrong here so all suggestions are in place.

    vb Code:
    1. 'Open connection
    2.             Dim DBPath As String
    3.             DBPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "/movies.mdb"
    4.             cn = New OleDbConnection(DBPath)
    5.             cn.Open()
    6.  
    7.  
    8.             str = "UPDATE moviedata SET Length = '" & Length.Text & "', Actors = '" & Actor.Text & "', Description = '" & Descrip.Text & "', Rating = '" & Rating.SelectedItem & "', Genre = '" & Genre.SelectedItem & "', Location = '" & FileLocation.Text & "' WHERE Title='" & Title.Text & "';"
    9.  
    10.             cn.Close()
    11.  
    12.             MsgBox("OK")
    13.  
    14.         Catch ex As Exception
    15.             MessageBox.Show(ex.ToString())
    16.  
    17.         End Try
    Last edited by maco; Apr 22nd, 2007 at 06:14 AM.

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