我在dsedit是这样设置的:
server name: user_14
server service: sql server
server status: 4 unknown
server address:tcp-172.20.2.18,8888
然后在sybase central用下面用户、密码可以登录上去
user id :sa
password: 888888
server name:user_14
最后,我在vb上代码是这样写的
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form1_Load()
Dim strConnect As String
Dim strSQL As String
strConnect = "Provider=MSDASQL.1;DRIVER={Sybase System 11}; " _
& " Persist Security Info=False;DSN=;" _
& " SRVR=user_14;DB=esmart;UID=sa;PWD=888888"
cnTest.Open strConnect
Set rs.ActiveConnection = conn
rs.CursorLocation = adUseClient
strSQL = "Select * from User_Info_Table"
rs.Open strSQL
Set DataGrid1.DataSource = rs
End Sub
现在问题是DataGrid1根本就没数据显示。我觉得原因在于连接不上sybase,不知道怎么写代码才能连上去,或者有什么其他解决办法