Native Client 10.1 - Sql

// Connection string SQLWCHAR connStr[] = L"Driver=SQL Server Native Client 10.0;" L"Server=localhost;Database=master;Trusted_Connection=yes;"; ret = SQLDriverConnectW(hdbc, NULL, connStr, SQL_NTS, NULL, 0, NULL, SQL_DRIVER_COMPLETE);

Provider=SQLNCLI10;Server=myServer;Database=myDB;Uid=myUser;Pwd=myPass; sql native client 10.1

Driver=SQL Server Native Client 10.0;Server=myServer;Database=myDB;Uid=myUser;Pwd=myPass; ret = SQLDriverConnectW(hdbc

Provider=SQLNCLI10;Server=myServer\instance;Database=myDB;Trusted_Connection=yes; Driver=SQL Server Native Client 10.0

if (SQL_SUCCEEDED(ret)) std::cout << "Connected!" << std::endl; SQLDisconnect(hdbc);

SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv); SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);