Re: C++ to Oracle DBMS Tools

From: Natan Pekerman <pnatan_at_actcom.co.il>
Date: 1995/12/10
Message-ID: <4afoc3$3tf_at_shelly.euronet.co.il>#1/1


In article <47ae83$p5h_at_news.puug.pt>, roquette_at_individual.puug.pt says...
>
>Hi,
>
>Does anyone know about tools to be used by C++ programs to access the
>ORACLE database ?
>
>THX
>

OMFC BOUND WIDGET LYBRARY



The basic classes of the Oracle Objects for OLE C++ Class Lybrary enable you to access the data in an Oracle database.You can fetch records, add records, execute arbitary SQL statments and so forth.However if you want to write a GUI program that displays database data, you are on your own. You must fetch the data, push the data into your GUI widgets, and repeat whenever the dynaset moves to a nother record. If the widget is used to edit the data, you must execute StartEdit, SetValue, Update cycle.  

The classes in this OMFC lybrary are subclasses of OBound. They provide GUI widget implemetations of OBound functionality. As a result you can create a form using Visual C++'s App Studio resource editor and, with very few lines of code, you can hook those widgets to database fields. You then have a working application.

example


//routine to create the states table.
int CreateStatesTable(void)
{

	OSession sess;		//database session object
	ODatabase datab;  	//the database object
	oresult ores;		//indicates whether operation succeeded

	//open the defualt (unnamed) session
	ores = sess.Open();
	if (oress != O_SUCCESS)
	{
	  ErrorMessage(sess.GetErrorText());
	  return(-1);
	}
	
	//connect to the database
  	ores = datab.Open(sess, "ExampleDB", "scott", "tigers");
	if (ores != O_SUCCESS)
	{
	  ErrorMessage(sess.GetServerErrorText());
	  return(-1);
	}  		
	
	//create the table
	const char *sqls = "create table states (name char(15), 
			    area number, population number) ";
	ores = datab.ExecuteSQL(sqls);
	if (ores != O_SUCCESS)
	{
	  ErrorMessage(sess.GetServerErrorText());
	  return(-1);
        }	  						 
	
	//everything went just fine
        return(0);

}

OMFC from experience works fast and reliable.



Natan Pekerman
1 Shvil Savion, K.Motzkin, 26354, Israel natan_at_euronet.co.il
+972-4-8700568
Received on Sun Dec 10 1995 - 00:00:00 CET

Original text of this message