¿ ADO String Connection SQL Server ?

¿ ADO String Connection SQL Server ?

Postby albeiroval » Wed Aug 14, 2013 10:52 pm

Good day to all,

I'm using ADO to work with SQL Server 2008.

I'm trying to connect to SQL Server 2008 from a computer to the SQL Server 2008 server without success.

I work in local mode the following Connection string (it connect):

Provider = SQLNCLI10, Server = myServerAddress; Database = MyDatabase; Trusted_Connection = yes;

But in remote mode does not work (testing from another computer)

The connection to the SQL server as I have the windows authentication (default).

What string should I use for remote connection?

What should I configure SQL Server 2008 to Remote Connection I?

Sorry my english,

From already thank you very much,

Best regards.

Albeiro,
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
User avatar
albeiroval
 
Posts: 363
Joined: Tue Oct 16, 2007 5:51 pm
Location: Barquisimeto - Venezuela

Re: ¿ ADO String Connection SQL Server ?

Postby Enrico Maria Giordano » Thu Aug 15, 2013 8:54 am

Albeiro,

I'm using the connection string below but I'm not sure it will work with your MSSQL version. Just try it:

Code: Select all  Expand view
Provider=SQLOLEDB;Data Source=<ipaddress>;Initial Catalog=<databasename>;User Id=<userid>;Password=<password>


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8378
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: ¿ ADO String Connection SQL Server ?

Postby Rick Lipkin » Thu Aug 15, 2013 1:21 pm

Albeiro

As Enrico mentions .. SqlOleDb still works even with Sql Server 2012 and SqlOleDb is native to all Windows OS... No real need at this point in time to install and use the SQLNCLI10 provider unless there is some function SqlOleDb does not provide.

I will mention, if you are having trouble connecting with 'remote' you will need to check your Sql Server settings to make sure 'remote' connections are turned on.

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2634
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: ¿ ADO String Connection SQL Server ?

Postby albeiroval » Thu Aug 15, 2013 5:04 pm

Enrico, Rick,

It seems to work well with:

Driver={SQL Server Native Client 10.0};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;

This SQL Express 20008,

Thanks,

Albeiro.
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
User avatar
albeiroval
 
Posts: 363
Joined: Tue Oct 16, 2007 5:51 pm
Location: Barquisimeto - Venezuela

Re: ¿ ADO String Connection SQL Server ?

Postby Rick Lipkin » Thu Aug 15, 2013 7:58 pm

Albeiro

Just remember .. if you distribute your application .. you will need to provide a setup routine to make sure each computer that runs your program has the SQLNCLI10 ole provider installed.

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2634
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: ¿ ADO String Connection SQL Server ?

Postby nageswaragunupudi » Thu Aug 15, 2013 11:47 pm

As Mr Rick said, SQLOLEDB is installed by default on all windows PCs and works well with all recent versions of SqlServer (including 2012).

If we want to connect through the native client SQLNCLI10, then we need to install this ourselves on all client PCs. For most work this is not necessary and SQLOLEDB is enough, unless we need to take advantage of all the latest features and new datatypes of the later versions.

Using Driver={SQL Server Native Client 10.0} connects through ODBC and does not allow us to take full potential of ADO. Always use Provider= .....
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ¿ ADO String Connection SQL Server ?

Postby byron.hopp » Mon Aug 26, 2013 4:06 am

You all my know this but:

Create a file on the hard drive with an extension of .udl

From the command prompt:
Type "copy con MyConStr.udl"
Press F6 to create the empty file
Type "Start MyConnStr.udl"
The UDL data wizard appears.
Answer the questions and press the test button to make sure it works, the connection string will be placed in the file.
Open the file with Notepad and pirate it into your code.

Hope this helps...

Byron ...
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 356
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 46 guests