Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003

    Unanswered: Import Oracle table data into MS Access thru Visual Basic 6 code.


    Could some one please help me with the above subject?

    I am developing an application in Visual Basic 6. In that, I have this
    requirement to import an Oracle database table data (only selected
    columns) into an MS Access database using Visual Basic 6 Code.
    After the table data import, I would use that table as reference
    in my VB application and probably use some of the information to
    populate into another table.

    I would appreciate if you could provide me with any sample code.

    Thank you in advance.



  2. #2
    Join Date
    Dec 2002

    Oracle and VB

    I picked up an excellent book called Oracle and Visual Basic Developer's Handbook on clearance at CompUSA (about $25). It is written by Oracle technical analysts, so the code is detailed and always works as expected. I recommend you get it if you are going to be doing much Oracle work.

    There are many ways to go about connecting to an Oracle db. However, the one recommended by Oracle is OO4O (Oracle Object for OLE), which allows you the most functionality.

    An example of how to connect using OO4O is:

    Dim OraSession as OraSession
    Dim OraDatabase as OraDatabase
    Dim OraDynaset as OraDynaset
    Set OraSession = CreateObject (*OracleInProcServer.XOraSession*)
    Set OraDatabase = OraSession.OpenDatabase ("v8i", "[user name]/[password]")

    You can then use standard SQL statements with the ExecuteSQL function, such as:

    OraDatabase.ExecuteSQL("Begin EmployeeName.GetEmpName (:EMPNO, :ENAME); end;")

    That should allow you to retrieve the table data you need. As I said, there are many other methods, so I suggest you get the book so you can decide which is the best for you. Good luck.

  3. #3
    Join Date
    Mar 2003

    Re: Import Oracle table data into MS Access thru Visual Basic 6 code.

    Hi Ixalmida,

    Thanks a lot for your reply. I have managed to do it using ADO though
    I am not sure if its the most efficient way (I am new to VB6). I would
    certainly try to get the book you suggested and check out what's in
    there. Thanks again for your suggestion.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts