Trying to connect to DB from Excel using VBA.
The following SQL command has some errors. I'm quite sure it's got to do with " ' " etc....but I couldn't figure out. Can someone help?
DeleteSQL = "DELETE * FROM TimeSheet WHERE " _
& "Name = '" & CStr(wb.Sheets("TimeSheet").Cells(3, 2).Value) & "'" _
& "Date = '" & FormatDateForSQL(TRangeC.Cells(i, 1).Value, conn) & "'" _
& "AmPm = '" & CStr(TRangeC.Cells(i, 3).Value) & "'"
---------------------------------
Your help is much appreciated, R.
---------------------------------
The following SQL command has some errors. I'm quite sure it's got to do with " ' " etc....but I couldn't figure out. Can someone help?
DeleteSQL = "DELETE * FROM TimeSheet WHERE " _
& "Name = '" & CStr(wb.Sheets("TimeSheet").Cells(3, 2).Value) & "'" _
& "Date = '" & FormatDateForSQL(TRangeC.Cells(i, 1).Value, conn) & "'" _
& "AmPm = '" & CStr(TRangeC.Cells(i, 3).Value) & "'"
---------------------------------
Your help is much appreciated, R.
---------------------------------