1 Reply Latest reply on Nov 13, 2008 2:45 PM by 669890

    OO4O to remote server?

    669890
      I have a database sitting on another computer and I'm trying to get my code in OO4O to connect to it. Here's what I have so far:

      #ifndef WIN32
      #define WIN32
      #endif

      #include <stdlib.h>
      #include <stdio.h>
      #include <iostream>
      #include "oracl.h"

      using namespace std;

      int main( void )
      {

      ODatabase odb;
      OValue val;

      OStartup();
      if(odb.Open("163.128.5.5:1521", "username", "password") == OFAILURE){
           cout << "Failure!" << endl;}
      ODynaset odyn(odb, "SELECT * FROM BARCODES");
      int i;
      while(!odyn.IsEOF()){
           odyn.GetFieldValue(0, &i);
           cout << i << endl;
           odyn.MoveNext();
      }
      OShutdown();
      return 0;
      }

      Besides the fact that every time I run this I get an output of Failure! I also get a memory exception error at the end. Any suggestions/

      PS: That is not actually the password or username to the account.