?
Solved

cannot connect SQLOLEDB to distance server

Posted on 2009-12-24
5
Medium Priority
?
656 Views
Last Modified: 2012-05-08
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


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;";

Open in new window

0
Comment
Question by:gudidi
  • 3
  • 2
5 Comments
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 2000 total points
ID: 26118242
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..
0
 

Author Comment

by:gudidi
ID: 26118273
i don't see in ODBC the sql native client could be the problem?
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 26118328
Kindly check over the list of possible connection strings available here:

http://www.connectionstrings.com/sql-server-2005

SQL Native client is required if you use SQLCLNI as the connection driver..
0
 

Author Comment

by:gudidi
ID: 26118331
yes this was the problem. thanks
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 26118372
Welcome..
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question