2024年5月24日发(作者:)
VB连接ORACLE数据库
VB连接ORACLE数据库
时间:2007-06-03
'打开数据库
Public Sub OpenOraDB()
On Error GoTo ToExit
OraDB_Open = False
Set OraDB = New tion
OraConstr = "Provider=.1;Password=" &
strOraPWD & ";User ID=" & strOraUser & ";Data Source=" &
OraDBNetName & ";Persist Security Info=False"
Location = adUseServer
OraConstr
OraDB_Open = True
Exit Sub
ToExit:
'MsgBox "连接数据库服务器错误,您可以在网络正常后继续使用。
",vbInformation , "错误信息"
OraDB_Open = False
End Sub
'关闭数据库
Public Sub CloseOraDB()
If OraDB_Open = True Then
If ( = adStateOpen) Then
Set OraDB = Nothing
OraDB_Open = False
End If
End If
End Sub
'打开数据集,写入数据
Set OraRS = New set
Connection = OraDB
Location = adUseServer
pe = adLockBatchOptimistic
strOraRS = "select * from " & OraDBtablename
adLockOptimistic
("PID") = strOraPID
("pname") = strName").Value
("psex") = strPsex
'关闭数据集
Set OraRS = Nothing
strOraRS, OraDB, adOpenStatic,
发布者:admin,转转请注明出处:http://www.yc00.com/web/1716527206a2728177.html
评论列表(0条)