Question : cannot connect SQLOLEDB to distance server

Hi Experts

i am testing a  program in C++ (found it in google...) which using the IRowSetFastLoad
to load a huge amount of records to SQL 2005.
i am using SQLOLEDB as provider. on my server it works fine, but when i change to another distance server,
i can not connect. do you see something wrong? should be the same way to connect in remote, no?
when i try to connect the distance server with ODBC all fine...

please advic
10x

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
works fine:
// Setup the initialization options
   ULONG cProperties = 0;
   DBPROP rgProperties[10];
   ULONG cPropSets = 0;
   DBPROPSET rgPropSets[1];
   LPWSTR pwszProgID = L"SQLOLEDB";
   LPWSTR pwszDataSource =NULL;
   LPWSTR pwszUserID =NULL;
   LPWSTR pwszPassword =NULL;
   LPWSTR pwszProviderString =L"data source=isr-x-gavi;DATABASE=SPEL_531_01_Copy;Trusted_Connection=yes;uid=sa;pwd=Password.1;";
  
not working:
// Setup the initialization options
   ULONG cProperties = 0;
   DBPROP rgProperties[10];
   ULONG cPropSets = 0;
   DBPROPSET rgPropSets[1];
   LPWSTR pwszProgID = L"SQLOLEDB";
   LPWSTR pwszDataSource =NULL;
   LPWSTR pwszUserID =NULL;
   LPWSTR pwszPassword =NULL;
   LPWSTR pwszProviderString=L"datasource=isrsdevdb;
DATABASE=A_TEST;Trusted_Connection=yes;uid=sa;pwd=Password.1;";

Answer : cannot connect SQLOLEDB to distance server

Connection string looks fine.
Kindly check whether remote connections are enabled in the remote SQL Server so that you would be able to connect to it..
Random Solutions  
 
programming4us programming4us