CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2000
    Posts
    2

    Remote Oracle Database Querying?

    All,

    I'm trying to connect to a remote Oracle database from a VB5 program using ODBC direct. I can open a DSN, create & run a query, and analyse the resulting records that are returned from the query, BUT ONLY WHEN THE APPLICATION IS RUNNING ON THE MACHINE WHICH ORACLE IS INSTALLED.
    The goal is to get the software running on a machine that "talks to" the Oracle database via a TCP/IP connection. I have created the TCP/IP link, and installed SQL*Net on both the server and the client machines and can open the DSN from a remote machine. However, the problem is that I can't create a QueryDef on the db. It's almost as if I've somehow got a read-only connection to the database, even though I can't see where this is set - do I have to specify a writeable connection as a parameter somewhere? The code I'm using is:


    set MP5DB = OpenDatabase("", 0, true, "ODBC;DSN= student;UID= student;PWD= student;")
    set qdfBonusEarners = MP5DB.CreateQueryDef("")

    With qdfBonusEarners
    .Connect = "ODBC;DATABASE=student;UID= student;PWD= student;DSN= student "
    .SQL = "SELECT * FROM STUDENT WHERE STUDENT.NAME='JONES'"
    set rstBonusRecipients = .OpenRecordset()
    End With




    I’d really appreciate any comments you may have as this is driving me crazy!

    TIA

    Si



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Remote Oracle Database Querying?

    you wrote:
    >It's almost as if I've somehow got a read-only connection to the database

    Indeed, the third parameter in your Opendatabase method call is true, which in fact is the readonly flag.
    >set MP5DB = OpenDatabase("", 0, true, "ODBC;DSN= student;UID= student;PWD= student;")




  3. #3
    Join Date
    Jan 2000
    Posts
    2

    Re: Remote Oracle Database Querying?

    Lothar,

    Thanks for the speedy reply - that was a mistake on my half - I've changed it to false, false and it still fails on the same call (CreateQueryDef). Any ideas?

    Thanks

    Si


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