我是这么写的
Dim intRet As Long '返回码
Dim strDriver As String '驱动程序
Dim strAttributes As String '描述字段
Dim rc As Integer 'ODBC 函 数 的 返 回 码
Dim henv As Long 'ODBC 环 境 句 柄
rc = SQLAllocEnv(henv) ' 获 取ODBC 环 境 句 柄 strDriver = "INFORMIX 2.80 32 BIT"
strAttributes = "SERVER=" & server.Text & Chr$(0)
strAttributes = strAttributes & "DESCRIPTION=" & Chr$(0)
strAttributes = strAttributes & "DSN=" & DsnName.Text & Chr$(0)
strAttributes = strAttributes & "DATABASE=" & database.Text & Chr$(0)
strAttributes = strAttributes & "Host=" & hostip.Text & Chr$(0)
strAttributes = strAttributes & "Service=" & service.Text & Chr$(0)
strAttributes = strAttributes & "Protocol=" & protocol.Text & Chr$(0)
strAttributes = strAttributes & "UID=" & username.Text & Chr$(0)
strAttributes = strAttributes & "PWD=" & pwd.Text & Chr$(0)
intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, strDriver, strAttributes)
总是建立失败,是不是我的连接字段有问题,请哪位帮忙解决一下,谢谢了
Dim intRet As Long '返回码
Dim strDriver As String '驱动程序
Dim strAttributes As String '描述字段
Dim rc As Integer 'ODBC 函 数 的 返 回 码
Dim henv As Long 'ODBC 环 境 句 柄
rc = SQLAllocEnv(henv) ' 获 取ODBC 环 境 句 柄 strDriver = "INFORMIX 2.80 32 BIT"
strAttributes = "SERVER=" & server.Text & Chr$(0)
strAttributes = strAttributes & "DESCRIPTION=" & Chr$(0)
strAttributes = strAttributes & "DSN=" & DsnName.Text & Chr$(0)
strAttributes = strAttributes & "DATABASE=" & database.Text & Chr$(0)
strAttributes = strAttributes & "Host=" & hostip.Text & Chr$(0)
strAttributes = strAttributes & "Service=" & service.Text & Chr$(0)
strAttributes = strAttributes & "Protocol=" & protocol.Text & Chr$(0)
strAttributes = strAttributes & "UID=" & username.Text & Chr$(0)
strAttributes = strAttributes & "PWD=" & pwd.Text & Chr$(0)
intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, strDriver, strAttributes)
总是建立失败,是不是我的连接字段有问题,请哪位帮忙解决一下,谢谢了
services文件中的service是我按照服务器端的设置自己加进去的,这样可以吧
SetNet32中的环境变量那么多,怎么设置?Server Information中的hostname和Host Information中的current host分别指的什么?
谢谢
server写服务器的机器名字还是"online",曾经有人告诉我写online