try Dim conn As ADODB.Connection conn = New ADODB.Connection conn.ConnectionString = "Provider=SQLOLEDB.1;Password=hailun.;Persist Security Info=True;User ID=sa;Initial Catalog=test;Data Source=voyo" conn.Open msgbox("成功") conn.close Catch ex As Exception msgbox("失败") End try