#include <cstdio> // for printf
#include <SQLAPI.h> // main SQLAPI++ header
int main(int argc, char* argv)
SAConnection con; // create connection object
// connect to database
// in this example it is Oracle,
// but can also be Sybase, Informix, DB2
// SQLServer, InterBase, SQLBase and ODBC
"test", // database name
"tester", // user name
"tester", // password
printf("We are connected!\n");
// Disconnect is optional
// autodisconnect will ocur in destructor if needed
printf("We are disconnected!\n");
// can also throw an exception
// (if a network error for example),
// we will be ready
// on error rollback changes
// print error message
printf("%s\n", (const char*)x.ErrText());
Well, I found out what the problem was, seems I was giving the Oracle connection parameter in my source program.
the correct one should be SA_ODBC_CLIENT which is for SQL Server connections.You know, another story just started to play as soon as this bug was identified.
libiodbc.so: cannot open shared object file: No such file or directory libiodbc.so.3: cannot open shared object file: No such file or directory libiodbc.so.2: cannot open shared object file: No such file or directory libodbc.so: cannot open shared object file: No such file or directory libodbc.so.1: cannot open shared object file: No such file or directory
DBMS API Library loading fails This library is a part of DBMS client installation, not SQLAPI++ Make sure DBMS client is installed and this required library is available for dynamic loading
You know, I think the SQLServer Driver is not included in the SQLAPI++. So, I think I need to install the unixODBC driver for SQLServer. You got the same idea?, moreover, if the case is right, I think m not gonna need SQLAPI++ anymore, as I guess, you know,
the ODBC manager driver automatically supports SQL APIs.
looking forward to hearing from you.
Moved bySSISJoostWednesday, June 19, 2013 6:26 PMNot SSIS related