日期:2014-05-17 浏览次数:20899 次
Private Sub Form_Load()
Dim ConnX As New ADODB.Connection
Dim sql As String
ConnX.ConnectionString = "Provider=MSDAORA.1;Password=***;User ID=***;Data Source=100.100.100.100;Persist Security Info=True"
On Error GoTo ConnErr
'连接数据库
ConnX.Open
MsgBox "连接数据库成功!服务已启动...", vbInformation, "连接"
'ConnX.Execute sql
'MsgBox 2222
End
Exit Sub
ConnErr:
MsgBox "连接数据库错误!", vbInformation, "连接"
End
End Sub