chci se naučit základy SQL++ a uz jsem si precetl par tutorialu. Nechce se mi to ale ani za nic zkompilovat. V Dev-c++ mi vždycky vyskočí chyba, že File format not recognized.
Kdybyste někdo věděl, jak to rozhejbat, bylo by to super
Thx
Chyba:
[img]
http://img139.imageshack.us/img139/575/sqlij0.gif
[/img]
Do parametrů projektu jsem hodil tohle:
libsqlapi.a
libsqlapidll.a
sqlapi.lib
sqlapib.lib
sqlapibs.lib
sqlapis.lib
sqlapiu.lib
sqlapius.lib
Kód mám tenhle
Kód: Vybrat vše
#include <stdio.h> // for printf
#include "SQLAPI.h" // main SQLAPI++ header
#include <iostream>
#include <windows.h>
int main(int argc, char* argv[])
{
SAConnection con; // create connection object
try
{
// connect to database
// in this example it is Oracle,
// but can also be Sybase, Informix, DB2
// SQLServer, InterBase, SQLBase and ODBC
con.Connect(
"test", // database name
"tester", // user name
"tester", // password
SA_Oracle_Client);
printf("We are connected!\n");
// Disconnect is optional
// autodisconnect will ocur in destructor if needed
con.Disconnect();
printf("We are disconnected!\n");
}
catch(SAException &x)
{
// SAConnection::Rollback()
// can also throw an exception
// (if a network error for example),
// we will be ready
try
{
// on error rollback changes
con.Rollback();
}
catch(SAException &)
{
}
// print error message
printf("%s\n", (const char*)x.ErrText());
}
system("pause");
return 0;
}

