关于VB中ADO远程连接数据库的困惑,请教大家
我用VB做了个远程数据库访问的软件,有几个问题不明白,希望大家帮帮我
在服务器上装有SQL server,并建好名为DBstu的SQL数据库,用户名:sa,密码:database,服务器的IP是:218.62.*.*
软件访问数据库的部分大概是:
ADO引用,DATAGRID控件
代码:
Option Explicit
Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Private Sub Form_Load()
Set adoConnection = New ADODB.Connection
adoConnection.Open "Provider=SQLOLEDB.1;Password=database;Persist Security Info=True;User ID=sa;Initial Catalog=DBstu;Data Source=218.62.*.*"
Set adoRecordset = New ADODB.Recordset
adoRecordset.CursorLocation = adUseClient
adoRecordset.Open "student", adoConnection, adOpenKeyset, adLockBatchOptimistic
'student为数据库DBstu中的一个数据表
Set DataGrid1.DataSource = adoRecordset
End Sub
问题是:
1、这个程序我在服务器上使用时能够连得上(用的是外网IP,就是上面的218.62.*.* ),但是再其它机子上(可以上网的)却连不上,显示 链接错误,SQL Server 不存在或访问被拒绝
2、假如ADO能够连上SQL数据库后,我想知道这种方法能够同时连接几个用户?
问题可能对你们来说很简单,但我真不懂,很急,希望大家能够帮忙,谢谢