excel vba 连接sql提取表格数据,怎么将代码里面的服务器、数据库用窗体里的文本框赋予? 200
ActiveWorkbook.Queries.AddName:="xxxx",Formula:=_"let"&Chr(13)&""&Chr(10)&"源=Sql.Data...
ActiveWorkbook.Queries.Add Name:="xxxx", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " 源 = Sql.Databases(""服务器"")," & Chr(13) & "" & Chr(10) & " 数据库= 源{[Name=""数据库""]}[Data]," & Chr(13) & "" & Chr(10) & " dbo_xxxx = 数据库{[Schema=""dbo"",Item=""xxxx""]}[Data]" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " dbo_xxxx" 展开
"let" & Chr(13) & "" & Chr(10) & " 源 = Sql.Databases(""服务器"")," & Chr(13) & "" & Chr(10) & " 数据库= 源{[Name=""数据库""]}[Data]," & Chr(13) & "" & Chr(10) & " dbo_xxxx = 数据库{[Schema=""dbo"",Item=""xxxx""]}[Data]" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " dbo_xxxx" 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询