I am beginner in c++,my problem on Linux for connecting to SQL Server with soci library, my code this but I have error and I don't found solution for my problem, my code this:
I have error:
[unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL state IM002)
Here is the code:
try{
soci::session sql("odbc","DSN=ODBC;UID=sa;PWD=sa123; Connection Driver=TDS;Database=ReportServer; Server=192.168.1.52;Port=1433;");
}
catch(soci::odbc_soci_error const & e){
cout<<"start error";
cout<<e.odbc_error_code()<<endl;
cout<<e.what();
}