Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OracleDataReader undeclared identifier error

OracleDataReader undeclared identifier error

Scheduled Pinned Locked Moved C / C++ / MFC
databaseoracledata-structuresdebugginghelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Reveille
    wrote on last edited by
    #1

    I have a function that queries an Oracle DB. It accepts two argumnets, a Command string and a Connection String. For some reason I receive two errors on each statement in my __finally block. Is there something wrong with my declarations? Errors: error C2065: 'myReader' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type error C2065: 'myOracleConnection' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type My code that generates the errors: cPacket ^queryPacket(String ^cmd, String ^con) { //test if the passed arguments are empty if(con->Equals("")) { MessageBox::Show("Oracle Connection String Empty o.O","Error in Form1::queryPacket"); } if(cmd->Equals("")) { MessageBox::Show("Oracle Command String Empty o.O","Error in Form1::queryPacket"); } try { OracleConnection ^myOracleConnection = gcnew OracleConnection(con); OracleCommand ^myOracleCommand = gcnew OracleCommand(cmd, myOracleConnection); myOracleConnection->Open(); OracleDataReader ^myReader = myOracleCommand->ExecuteReader(CommandBehavior::CloseConnection); myReader->Close();//I put this in here to debug. The statement doesnt throw any errors and inteliSense picks up the myReader object so I'm assuming that it works fine. }//end try catch (Exception ^ex) { MessageBox::Show(ex->Message,"Exception in class PaCCaP's function queryPacket", MessageBoxButtons::OK, MessageBoxIcon::Exclamation); }//end catch __finally { myReader->Close(); //this is where the first 2 errors are generated myOracleConnection->Close(); //and the second 2 }//end finally I'm hoping this is something small that I've overlooked, possibly in my declarations? Also, It It's not too much to ask, How do you create a 1-dimensional array of objects in the 2005 syntax (I just switched over from 2003 and trackable ^ pointers are a bit fuzzy to me. All suggestions are welcomed. Thanks!

    H 1 Reply Last reply
    0
    • R Reveille

      I have a function that queries an Oracle DB. It accepts two argumnets, a Command string and a Connection String. For some reason I receive two errors on each statement in my __finally block. Is there something wrong with my declarations? Errors: error C2065: 'myReader' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type error C2065: 'myOracleConnection' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type My code that generates the errors: cPacket ^queryPacket(String ^cmd, String ^con) { //test if the passed arguments are empty if(con->Equals("")) { MessageBox::Show("Oracle Connection String Empty o.O","Error in Form1::queryPacket"); } if(cmd->Equals("")) { MessageBox::Show("Oracle Command String Empty o.O","Error in Form1::queryPacket"); } try { OracleConnection ^myOracleConnection = gcnew OracleConnection(con); OracleCommand ^myOracleCommand = gcnew OracleCommand(cmd, myOracleConnection); myOracleConnection->Open(); OracleDataReader ^myReader = myOracleCommand->ExecuteReader(CommandBehavior::CloseConnection); myReader->Close();//I put this in here to debug. The statement doesnt throw any errors and inteliSense picks up the myReader object so I'm assuming that it works fine. }//end try catch (Exception ^ex) { MessageBox::Show(ex->Message,"Exception in class PaCCaP's function queryPacket", MessageBoxButtons::OK, MessageBoxIcon::Exclamation); }//end catch __finally { myReader->Close(); //this is where the first 2 errors are generated myOracleConnection->Close(); //and the second 2 }//end finally I'm hoping this is something small that I've overlooked, possibly in my declarations? Also, It It's not too much to ask, How do you create a 1-dimensional array of objects in the 2005 syntax (I just switched over from 2003 and trackable ^ pointers are a bit fuzzy to me. All suggestions are welcomed. Thanks!

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      Is your code CLI/C++ so ask on the (Managed) C++/CLI[^]


      WhiteSky


      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups