FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ¿ ADO String Connection SQL Server ?
Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
¿ ADO String Connection SQL Server ?
Posted: 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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: ¿ ADO String Connection SQL Server ?
Posted: Thu Aug 15, 2013 08: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 (fw): Select all Collapse
Provider=SQLOLEDB;Data Source=<ipaddress>;Initial Catalog=<databasename>;User Id=<userid>;Password=<password>


EMG
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: ¿ ADO String Connection SQL Server ?
Posted: Thu Aug 15, 2013 01: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

Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
Re: ¿ ADO String Connection SQL Server ?
Posted: Thu Aug 15, 2013 05: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
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: ¿ ADO String Connection SQL Server ?
Posted: Thu Aug 15, 2013 07: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

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ¿ ADO String Connection SQL Server ?
Posted: 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
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: ¿ ADO String Connection SQL Server ?
Posted: Mon Aug 26, 2013 04: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

Continue the discussion