CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 1999
    Posts
    16

    DSN-Less connections to Oracle DB, using RDO

    Hi,

    I am trying to connect to an Oracle DB, installed on an AIX m/c, through a VB appl, from WindowsNT works. As per my documentation, we have to provide a connect string of the type:

    cnstr="driver={Microsoft ODBC Driver for Oracle}; Server=XXXX; UID=XXX; pwd=xxx"

    Could some one please tell me what should be entered for Server=....

    Where should the name of the Oracle database, "XXX.XXX.world" (as defined in the tnsnames.ora), be specified in the conect string.

    regards
    Jeevan S

    (PS: I would be very grateful, if some one could guide me to/ email me sample VB applications which use RDO/RDC to connect to Oracle databases. My email: "[email protected]" )



  2. #2
    Join Date
    Apr 1999
    Posts
    8

    Re: DSN-Less connections to Oracle DB, using RDO

    Hello Jeevan,

    The value for server shud b the windows nt serevr name. For example, if the windows nt server name for oracle system is "Orasys" u'r connect string wud look like :
    with cn
    .connect = "server=orasys;driver={microsoft ODBC for Oracle};uid=XXX;pwd=XXX"
    .establishconnection [rddrivernoprompt | rddriverprompt ], [<options>]
    end with

    Pls ensure that no spaces exist unnecessarily within the connect argument string. If u r still unsure of the oracle server try giving the option as rddrivercompleterequired. If the server is on the local machine then the value for the server can be given as "server=(local)"

    u shud b able to get the connection withou any error. the user id and password, is of the login for the oracle and not of that of windows nt , of course. Do let me know if u still face any problem. ( Not that i am MR.Know-All in VB, but then, togehter v might b able to solve it!). do let me know if u succeed also !

    Take care
    Jay.

    Ciao till i find more questions to make life more complicated......

  3. #3
    Join Date
    May 1999
    Posts
    16

    Re: DSN-Less connections to Oracle DB, using RDO

    Genie,
    Thanx for u'r advice.
    However I would like to draw u'r attention to, my original post, wherein I had said that my oracle server is on an AIX m/c, not windows NT.
    Anyway, I found the answer by browsing CodeGuru, in detail
    It led me to a MS Kb article, Q167225, which explains the DSN-Less connections to Oracle.

    For the benefit of others:
    In breif, use the connect string
    "UID=;PWD=;driver={Microsoft ODBC driver for Oracle}; CONNECTSTRING=myOracle.db.world"
    in the en.openConnection() method of a rdoConnection variable.

    As can be seen, the CONNECTSTRING=, above is the Oracle database alias, as setup in the TNSNAMES.ORA file, using SQL*Net
    The VB code is

    Dim cn As rdoConnection
    Dim en As rdoEnvironment
    cnstr = "UID=;PWD=;driver={Microsoft ODBC Driver for Oracle};" & _
    "CONNECTSTRING=MyOracle.database_alias.world;"

    Set en = rdoEnvironments(0)
    Set cn = en.OpenConnection("", rdDriverPrompt, False, cnstr)
    ....
    ....
    ....
    ....

    regards

    Jeevan



  4. #4
    Guest

    Re: DSN-Less connections to Oracle DB, using RDO

    Hai


  5. #5
    Guest

    Re: DSN-Less connections to Oracle DB, using RDO

    How to use ADD-INs?


  6. #6
    Join Date
    May 1999
    Posts
    16

    Re: DSN-Less connections to Oracle DB, using RDO

    IN the VB IDE, Add-INS, menu, click Add-IN manager.
    This will open a dialog, showing all available Add-INS.

    Select any and click Ok!

    Now the selected Add-INs will now appear in the VB-IDE, Add-INs menu.

    regards






Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured