本文介绍了如何为SQL Server 2008 R2创建dsn的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码与
相同
my code is as under
CMD.CommandText = "select @@SERVERNAME"
RS = CMD.Execute
servername = RS.Fields(0).Value
SERVER_NAME = RS.Fields(0).Value
Attributes = "SERVER=" & SERVER_NAME & Chr(0)
Attributes = Attributes & "DSN=" & dataname & Chr(0)
Attributes = Attributes & "DATABASE=" & dataname & Chr(0)
Attributes = Attributes & "Trusted_Connection=yes" & Chr(0)
'Attributes = Attributes & "uid='sa'" & Chr(0)
'Attributes = Attributes & "pwd='mipl'" & Chr(0)
'To show dialog, use Form1.Hwnd instead of vbAPINull.
MsgBox(Attributes)
intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, Driver, Attributes)
请告诉我我的错误
在此先感谢
please tell me my mistake
thanks in advance
推荐答案
这篇关于如何为SQL Server 2008 R2创建dsn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!