HELP!VB如何连接ORACLE数据库?

解决方案 »

  1.   

    在odbc中有一个microsoft odbc for oracle驱动,用它应该能连上
      

  2.   

    没有用过
    Dim OraSess as Object
    Dim OraDb as Object
    Dim Dyna as ObjectSet OraSess = CreateObject("OracleInProcServer.XOraSession")
    Set OraDb = OraSess.DbOpenDatabase("oracle8","scott/tiger",0&)
    ' In the Above Command
    'FirstParameter ("oracle8") is the Database Name or the HostString
    'SecondParameter ("scott/tiger") is the UserName/Password
    Set Dyna = OraDb.CreateDynaSet("Select * from Emp",0&)
    for i = 0 to Dyna.RecordCount
    text1 = Dyna.Fields(0).Value
    text2 = Dyna.Fields(1).Value
    text3 = Dyna.Fields(2).Value
    text4 = Dyna.Fields(3).Value
    Dyna.DbMoveNext
    Next i