Recently found a good thing on the Internet sqlapi++, it is available to access multiple SQL databases (oracle,sql server,db2,sybase,informix,interbase,sqlbase,mysql,postgresql) C+ + Library. sqlapi++ directly invokes the APIs of the local Target database management system (DBMS) (unlike ADO using the OLE DB and/or ODBC intermediate). The sqlapi++ Library acts as a middleware to indirectly access the role of the database, which is why sqlapi++ is the quickest way to access a database. You no longer need to install and configure OLE DB and/or ODBC drivers when developing and publishing your applications.
The development platform supported by SQLAPI is Microsoft Visual C++,borland C + + Builder,gun Project C and C + + Compiler.
The sample code is as follows:
#include <stdio.h>/For printf
#include <SQLAPI.h>//main sqlapi++ header
int main (int argc, char* argv[])
{
Saconnection con; Connecting Data Objects
Sacommand cmd (
&con,
"Select FID, Fvarchar20 from Test_tbl"); Command object, which contains a query statement,//You can modify it as needed when you test it.
Try
{
Connecting to a database
The Oracle database is connected to this routine.
Of course it can also be connected to Sybase, Informix, DB2
SQL Server, InterBase, SQLBase and ODBC
Con. Connect ("Test", "Tester", "tester", sa_oracle_client);
This paper studies from C++builder-HTTP://WWW.CCRUN.COM/ARTICLE.ASP?I=1020&D=SSOQRD
Executing query statements
Cmd. Execute ();
Show results after a query
while (CMD. Fetchnext ())
{
printf ("Row Fetched:fid =%ld, Fvarchar20 = '%s ' \ n",
Cmd. Field ("FID"). Aslong (),
(const char*) cmd. Field ("Fvarchar20"). asstring ());
}
Commit the current transaction
Con.commit ();
printf ("Rows selected!\n");
}
catch (Saexception &x)
{
Exception handling
Try
{
Exit Current transaction
Con. Rollback ();
}
catch (Saexception &)
{
}
Display error messages
printf ("%s\n", (const char*) x.errtext ());
}
return 0;
}
Sqlapi++ 's official website is www.sqlapi.com, which provides evaluation versions to customers for testing. Unfortunately, a MessageBox dialog box pops up after the evaluation version of the library file succeeds in connecting to the database. I was very annoyed when testing it, and then I cracked it, if necessary, can go to my personal website to download it www.szsmart.net, but only provide BCB cracked version.
Sqlapi Library crack Download
This article supporting source code