EXCEL VB 调用A2单元格,输入A2不能自动刷新C10,需要在VB中运行才可以刷新C10,请问是什么原因?
PrivateSubTEST()Setconn=CreateObject("adodb.connection")conn.Open"Driver=SQLServer;SE...
Private Sub TEST()
Set conn = CreateObject("adodb.connection")
conn.Open "Driver=SQL Server;SERVER=locad;Database=DEMO;uid=sa;pwd=test"
sqll = "select * from DEMO.RETS where TS001='" & [A2] & "'"
Set rs1 = conn.Execute(sqll)
Range("C10").CopyFromRecordset rs1
End If
End Sub 展开
Set conn = CreateObject("adodb.connection")
conn.Open "Driver=SQL Server;SERVER=locad;Database=DEMO;uid=sa;pwd=test"
sqll = "select * from DEMO.RETS where TS001='" & [A2] & "'"
Set rs1 = conn.Execute(sqll)
Range("C10").CopyFromRecordset rs1
End If
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询