pass string variable without quotes in query vba

前端 未结 3 1217
不知归路
不知归路 2021-01-27 07:44
Dim StoreNoToUpdate As String
Dim Marsha As String

StoreNoToUpdate = \"ABCXYZ123\"

Marsha = \"hi\"

db.Execute \"Update TblLod         


        
3条回答
  •  执笔经年
    2021-01-27 07:49

    Try:

    Dim StoreNoToUpdate As String
    Dim Marsha As String
    
    StoreNoToUpdate = "ABCXYZ123"
    
    Marsha = "hi"
    
    Db.Execute "Update TblLodgingReport set [MarshaCode]='" & Marsha & "'where [Store Number ID]= 'ABCXYZ123'"
    

提交回复
热议问题