[讨论]不知问题出在哪!
											我在和SQL Server2000相连时用如下代码:
1.模块中的代码:
Public Function connectDB()
    Set adoCn = New ADODB.Connection
    adoCn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;" & _
        "Persist Security Info=False;User ID=UID;Initial Catalog=DSN;Data Source=SERV"
    adoCn.Open 
    Set adoRS = New ADODB.Recordset
    Set adoRS.ActiveConnection = adoCn
End Function
2.主窗体的代码:
Private Sub Form_Load()
'连接数据库
    On Error GoTo ErrMsg
    Call transDB
    .........
end sub
3.登录界面的代码
Private Sub cmdLogin_Click()
   DSN = txtDB.Text
   SERV = "cobServer.Text"
   UID = txtUserName.Text   
   Unload Me
   frmInquiry.Show
End Sub
我把连接字符窜中的DSN/SERV/UID由登录界面传递过去怎么就连不上呢?、
而直接写就可以,是不是格式不对?
另外有谁知道怎么自动获得局域网中的在线SQL服务器,并添加在登录对话框的列表里?										
					
	


 
											





 
	    

 
	



