以下TSQL语句要在VB中执行,怎么写语法
EXECsp_addlinkedserver'ITSV','','SQLOLEDB','192.168.1.100';EXECsp_addlinkedsrvlogin'I...
EXEC sp_addlinkedserver 'ITSV', ' ', 'SQLOLEDB', '192.168.1.100';
EXEC sp_addlinkedsrvlogin 'ITSV', 'false',null, 'sa', '123';
insert openquery(ITSV, 'SELECT * FROM 测试.dbo.AA')
select * from AA
except
select * from ITSV.测试.dbo.AA
EXEC sp_dropserver 'ITSV ', 'droplogins ' 展开
EXEC sp_addlinkedsrvlogin 'ITSV', 'false',null, 'sa', '123';
insert openquery(ITSV, 'SELECT * FROM 测试.dbo.AA')
select * from AA
except
select * from ITSV.测试.dbo.AA
EXEC sp_dropserver 'ITSV ', 'droplogins ' 展开
1个回答
展开全部
直接使用:EXEC sp_dropserver 'ITSV ', 'droplogins '就好了。VB代码不能用recordset来操作应该用链接独享去excute
Dim cnn As ADODB.Connection
Set cnn=new ADODB.Connection
cnn.ConnectionString="Driver={SQL Server};UID=sa;PWD=111;DataBase=112a"
cnn.Open
cnn.Excute "EXEC sp_dropserver 'ITSV ', 'droplogins'"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询