vb2005連接問題
我用的是VB2005數據庫是SQL SERVER 2000 但是每次聯接時,總是提示連接SQL SERVER 2005 失敗。因為我沒有裝SQL 2005
還是我的代碼打錯了
Dim i As Integer
Dim strcon, strcmd As String
strcon = "Persist Security Info=False;User ID=sa;Initial Catalog=.;Data Source=test;"
Dim sqlcon As SqlConnection = New SqlConnection(strcon)
sqlcon.Open()
strcmd = "select * from t_login"
'where tda='1'"
Dim sqlcmd As SqlCommand = New SqlCommand(strcmd, sqlcon)
Dim dr As SqlDataReader
dr = sqlcmd.ExecuteReader
Do While dr.Read()
'TextBox1.Text = RS_up.Tables(0).Rows(1)("id")
'For i = 0 To dr.FieldCount - 1
If TextBox1.Text = dr.Item(3) Then
MsgBox("a")
Exit Sub
End If
'Exit For
'Next
Loop