Without Any Control and Without Any References You Can Connect To Oracle
Without Any Control and Without Any References You Can Connect To Oracle
API Declarations
Public OraDatabase As Object
Public Emp As Object
'Connection Information
Global UserName
Global PassWord
Global DetaBaseName
Global Connect
Rate Without Any Control and Without Any References You Can Connect To Oracle
(2(2 Vote))
UserName = lUsername.Text
PassWord = lpassword.Text
DatabaseName = lDatabaseName.Text
Connect = UserName + "/" + PassWord
On Error GoTo om
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.DbOpenDatabase(DatabaseName, Connect, 0&)
Set Emp = OraDatabase.CreateDynaset("select * from emp", 0&)
Text1.Text = Emp.Fields("deptno").Value
Text2.Text = Emp.Fields("empno").Value
Text3.Text = Emp.Fields("ename").Value
Text4.Text = Emp.Fields("sal").Value
Text5.Text = Emp.Fields("job").Value
om:
If OraSession.LastServerErr = 0 Then
If Err = 0 Then
MsgBox ("Normal, successful completion")
Else
MsgBox ("VB-" & Err & " " & Error)
End If
Else
MsgBox (OraSession.LastServerErrText)
End If
End Sub
Without Any Control and Without Any References You Can Connect To Oracle Comments
No comments yet — be the first to post one!
Post a Comment