Public Sub openoradb ()
On Error GoTo Toexit
Oradb_open = False
Set oradb = New ADODB. Connection
Oraconstr = "PROVIDER=ORAOLEDB.ORACLE.1; Password= "& Strorapwd &"; User id= "& Strorauser &";D ata source= "& Oradbnetname &"; Persist Security Info=false "
Oradb.cursorlocation = adUseServer
Oradb.open Oraconstr
Oradb_open = True
Exit Sub
Toexit:
' MsgBox ' connection to the database server error, you can continue to use after the network is normal. ", vbinformation," error message "
Oradb_open = False
End Sub
' Close the database
Public Sub closeoradb ()
If Oradb_open = True Then
If (oradb.state = adStateOpen) Then
Oradb.close
Set oradb = Nothing
Oradb_open = False
End If
End If
End Sub
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.