Hi everyone,
I have the following query
This query works fine from access query designer.
Now I want to use in vb.net and I can't seem to get it to work.
[highlight #EF2929]newPath contains the new path of the images[/highlight]
I know what my problem is, I just don't know how to fix it. I highlighted the error in yellow.
How do I incorporate the [imagename] field in to the update query?
Thanks
Ed
I have the following query
Code:
UPDATE PAYTEST SET PAYTEST.ImageName = "C:\Client\AppName\Images\" & [imagename] & " *.TIF";
This query works fine from access query designer.
Now I want to use in vb.net and I can't seem to get it to work.
[highlight #EF2929]newPath contains the new path of the images[/highlight]
Code:
Public Shared Function UpdateImagePathMSAccess(ByVal newPath As String)
Try
Dim connection As New OleDbConnection(TimesheetsDB.GetConnection)
connection.Open()
Dim strQuery As String = _
"Update PayTest Set Imagename = @newPath"
Dim cmd As New OleDbCommand(strQuery, connection)
cmd.Parameters.AddWithValue("@newPath", newPath [highlight #EDD400]& "\& [imagename] & "".TIF"" ")[/highlight]
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error updating image path")
End Try
End Function
I know what my problem is, I just don't know how to fix it. I highlighted the error in yellow.
How do I incorporate the [imagename] field in to the update query?
Thanks
Ed