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,
¿ ADO String Connection SQL Server ?
- albeiroval
- Posts: 383
- Joined: Tue Oct 16, 2007 5:51 pm
- Location: Barquisimeto - Venezuela
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: ¿ ADO String Connection SQL Server ?
Albeiro,
I'm using the connection string below but I'm not sure it will work with your MSSQL version. Just try it:
EMG
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
Provider=SQLOLEDB;Data Source=<ipaddress>;Initial Catalog=<databasename>;User Id=<userid>;Password=<password>
EMG
- Rick Lipkin
- Posts: 2668
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: ¿ ADO String Connection SQL Server ?
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
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
- albeiroval
- Posts: 383
- Joined: Tue Oct 16, 2007 5:51 pm
- Location: Barquisimeto - Venezuela
Re: ¿ ADO String Connection SQL Server ?
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.
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.
- Rick Lipkin
- Posts: 2668
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: ¿ ADO String Connection SQL Server ?
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
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
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: ¿ ADO String Connection SQL Server ?
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= .....
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
G. N. Rao.
Hyderabad, India
-
- Posts: 388
- Joined: Sun Nov 06, 2005 3:55 pm
- Location: Southern California, USA
- Contact:
Re: ¿ ADO String Connection SQL Server ?
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 ...
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
Matrix Computer Services