VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Without Any Control and Without Any References You Can Connect To Oracle

by OMKAR K. YADAV (4 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 20th November 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



   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

Download this snippet    Add to My Saved Code

Without Any Control and Without Any References You Can Connect To Oracle Comments

No comments have been posted about Without Any Control and Without Any References You Can Connect To Oracle. Why not be the first to post a comment about Without Any Control and Without Any References You Can Connect To Oracle.

Post your comment

Subject:
Message:
0/1000 characters