Single & Double quotes?
I had been having trouble finding VB code to update records in a database. I found many different examples but the following is the only one I found that actually worked for me.
Dim updateRec as String
updateRec = "UPDATE dbo_HB_ITEMMASTER SET dbo_HB_ITEMMASTER.Total_AuthQty = '" & Me.txtNewAuthTotal & "', dbo_HB_ITEMMASTER.Auth_Bal = '" & Me.txtNewAuthBal & "' WHERE dbo_HB_ITEMMASTER.PartNum = '" & Me.cboHBItem & "'"
CurrentProject.Connection.Execute updateRec
I understand the SQL statement but can someone explain the punctuation? The difference between the double quote and single quote? I’ve seen example code which just uses the double quotes but that never seems to work for me.
I am using this code but I’d like to completely understand what it’s doing, or what the punctuation is doing, especially the single quotes.
I had been having trouble finding VB code to update records in a database. I found many different examples but the following is the only one I found that actually worked for me.
Dim updateRec as String
updateRec = "UPDATE dbo_HB_ITEMMASTER SET dbo_HB_ITEMMASTER.Total_AuthQty = '" & Me.txtNewAuthTotal & "', dbo_HB_ITEMMASTER.Auth_Bal = '" & Me.txtNewAuthBal & "' WHERE dbo_HB_ITEMMASTER.PartNum = '" & Me.cboHBItem & "'"
CurrentProject.Connection.Execute updateRec
I understand the SQL statement but can someone explain the punctuation? The difference between the double quote and single quote? I’ve seen example code which just uses the double quotes but that never seems to work for me.
I am using this code but I’d like to completely understand what it’s doing, or what the punctuation is doing, especially the single quotes.