【问题标题】:Join from sql table to Excel Sheet从 sql 表连接到 Excel 表
【发布时间】:2017-06-24 18:08:37
【问题描述】:

面对运行时错误说

语法错误

C:\Users\Emp_ID\Desktop\FolderName\FileName.xlsm附近

set rs = cnn.Execute("update EO_datawh.dbo.TableName set email_status = 'Sent' From '" & ThisWorkbook.FullName & "'.'Sheet1$' a join EO_datawh.dbo.TableName b on a.sr_number = b.sr_number")

【问题讨论】:

    标签: mysql sql-server excel vba


    【解决方案1】:

    在 UPDATE 之后使用别名“b”而不是“EO_datawh.dbo.TableName”:

    set rs = cnn.Execute("update b set email_status = 'Sent' From '" & ThisWorkbook.FullName & "'.'Sheet1$' a join EO_datawh.dbo.TableName b on a.sr_number = b.sr_number")
    

    【讨论】:

    • 同样的错误 Syas Incorrect Syntax Near 'C:\Users\Emp_ID\Desktop\FolderName\FileName.xlsm'
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多