贴错了,应是这条错在哪里?
conn.Execute "delete from opendatasource('SQLOLEDB','Data source=" & strip & ";uid=sa;pwd=" & strpwd & "').ypjxc.dbo.仓库表 as a where a.药店编号='" & Trim(ydbh) & "'"
conn.Execute "delete from opendatasource('SQLOLEDB','Data source=" & strip & ";uid=sa;pwd=" & strpwd & "').ypjxc.dbo.仓库表 as a where a.药店编号='" & Trim(ydbh) & "'"
OPENDATASOURCE('SQLOLEDB','DataSource=10.11.120.11;uid=sa;pwd=123').ypjxc.dbo.仓库表(药店编号,药店名称,仓库编码,仓库名称,类别,负责人,位置,备注)
select 药店编号,药店名称,仓库编码,仓库名称,类别,负责人,位置,备注 from ypjxc.dbo.仓库表
conn.Execute "delete from opendatasource('SQLOLEDB','Datasource="& strip &";uid=sa;pwd="& strpwd &"').ypjxc.dbo.仓库表 where 药店编号='"& Trim(ydbh) &"'"你试下这个 可能因为你的字符串在连接时,多了些空格
------------------
学习 :)