Wednesday, March 28, 2012
How to connection to ODBC data source ?
How to connect via ODBC
Hi,
I would like to connect in SqlServer 2005 via ODBC SQLServer, how are the steps?
1 - How can I connect ODBC?
1.1 - I need SqlServer 2005 name - ok
1.2 - Which option should I take in order to login? Windows NT authentication or Sql Server authentication?
Which one is the best option?
Cheers,
Alessandro
1.2 - Which option should I take in order to login? Windows NT authentication or Sql Server authentication?
That depends - Windows authentication is almost always better but if you cannot use it then SQL Server authentication is fine as long as you have it enabled on the server and you have created a login on the server. With Windows authentication you can easily use existing Windows domains, groups and users, you don't have to create everything on the server and use extra login names and passwords.
What type of application are you using to connect to SQL Server? ODBC should be your last choice, rather use OLE DB or the .NET data provider if you can.
|||Hi,
- I picked windows authentication. I can not use OLE DB from my application.
I've created one windows user and created one login, but I still getting "Not associated with a trusted SQL Server connection". I changed Surface Area configuration and Configuration Manager as well. I heard that I nedd to enable mix mode option, how can I do this?
thanks
|||You haven't told me anything about your application or why you can't use OLE DB, so I'm guessing - but it sounds like you cannot use Windows authentication. In SQL Server Management Studio, right click your server and select Properties. Select the Security page, and on that page select the SQL Server and Windows Authentication mode radio button.
Then add a SQL Server login, and use that login and password in your connection string.
How to connect to the SQl server EXPRESS using 'ODBC Data Source A
Recently I have installed SQl server express edition. I was able to connect
to the SQL server from my .NET project using connection parameter like:
Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\Raju\My
Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
Security=True;Connect Timeout=30;User Instance=True
Now I need to connect to the same SQL server from 'ODBC Data Source
Aministrator' wizard, that I am unable to do. The wizard is asking me (for
system DSn and File DSN) for SQL server name (I do no know what to give, is
it (local) or something) and how to login authenticate (with windows
authentication or something). Now if I goto Services/SQl Server (SQLEXPRESS)
, click LogOn I see that 'Local System Account' is checked. Pls tell me how
to connect to this SQl server using System DSN connection wizard.
By the way I am the administrator of this machine where I have instlled the
SQl server...
Thanks in advance,
--
Sanjib SahaHi
VB.NET
Imports System.Data.Odbc
Dim oODBCConnection As OdbcConnection
Dim ConnString As String = _
"Driver={SQL Server};" & _
"Server=SQLServerName;" & _
"Database=DatabaseName;" & _
"Uid=Username;" & _
"Pwd=Password"
oODBCConnection = New Odbc.OdbcConnection(ConnString)
oODBCConnection.Open()
"sanjib" <sanjib@.discussions.microsoft.com> wrote in message
news:7BE14AB4-9460-4489-B7CB-62880592EFC6@.microsoft.com...
> Hi All,
> Recently I have installed SQl server express edition. I was able to
> connect
> to the SQL server from my .NET project using connection parameter like:
> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and
> Settings\Raju\My
> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
> Security=True;Connect Timeout=30;User Instance=True
> Now I need to connect to the same SQL server from 'ODBC Data Source
> Aministrator' wizard, that I am unable to do. The wizard is asking me (for
> system DSn and File DSN) for SQL server name (I do no know what to give,
> is
> it (local) or something) and how to login authenticate (with windows
> authentication or something). Now if I goto Services/SQl Server
> (SQLEXPRESS)
> , click LogOn I see that 'Local System Account' is checked. Pls tell me
> how
> to connect to this SQl server using System DSN connection wizard.
> By the way I am the administrator of this machine where I have instlled
> the
> SQl server...
> Thanks in advance,
> --
> Sanjib Saha|||The OP indicates that he is using SQL Server 2005 Express' User Instance. I
do not think he can connect to User Instance through ODBC DSN Wizard (why
use ODBC anyway?). I am not should if it is possible to connect to SQL
Server Express' User Instance through OdbcConnection object in
System.Data.Odbc namespace, but it is certain your sample code will not.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23QvKqzLoGHA.4332@.TK2MSFTNGP03.phx.gbl...
> Hi
> VB.NET
> Imports System.Data.Odbc
> Dim oODBCConnection As OdbcConnection
> Dim ConnString As String = _
> "Driver={SQL Server};" & _
> "Server=SQLServerName;" & _
> "Database=DatabaseName;" & _
> "Uid=Username;" & _
> "Pwd=Password"
> oODBCConnection = New Odbc.OdbcConnection(ConnString)
> oODBCConnection.Open()
>
> "sanjib" <sanjib@.discussions.microsoft.com> wrote in message
> news:7BE14AB4-9460-4489-B7CB-62880592EFC6@.microsoft.com...
>> Hi All,
>> Recently I have installed SQl server express edition. I was able to
>> connect
>> to the SQL server from my .NET project using connection parameter like:
>> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and
>> Settings\Raju\My
>> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
>> Security=True;Connect Timeout=30;User Instance=True
>> Now I need to connect to the same SQL server from 'ODBC Data Source
>> Aministrator' wizard, that I am unable to do. The wizard is asking me
>> (for
>> system DSn and File DSN) for SQL server name (I do no know what to give,
>> is
>> it (local) or something) and how to login authenticate (with windows
>> authentication or something). Now if I goto Services/SQl Server
>> (SQLEXPRESS)
>> , click LogOn I see that 'Local System Account' is checked. Pls tell me
>> how
>> to connect to this SQl server using System DSN connection wizard.
>> By the way I am the administrator of this machine where I have instlled
>> the
>> SQl server...
>> Thanks in advance,
>> --
>> Sanjib Saha
>|||Norman,
There should be some way to connect to the SQl server 2005 Express user
instance. I need to connect to this SQl server b'case one of my application
is demandint that...There should be some way, tht we do not know...Anyway
thanks...Someone pls guide me...
Thanks,
Sanjib
--
Sanjib Saha
"sanjib" wrote:
> Hi All,
> Recently I have installed SQl server express edition. I was able to connect
> to the SQL server from my .NET project using connection parameter like:
> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\Raju\My
> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
> Security=True;Connect Timeout=30;User Instance=True
> Now I need to connect to the same SQL server from 'ODBC Data Source
> Aministrator' wizard, that I am unable to do. The wizard is asking me (for
> system DSn and File DSN) for SQL server name (I do no know what to give, is
> it (local) or something) and how to login authenticate (with windows
> authentication or something). Now if I goto Services/SQl Server (SQLEXPRESS)
> , click LogOn I see that 'Local System Account' is checked. Pls tell me how
> to connect to this SQl server using System DSN connection wizard.
> By the way I am the administrator of this machine where I have instlled the
> SQl server...
> Thanks in advance,
> --
> Sanjib Saha|||You can access an User Instance once it is started by specifying the Named
Pipe name for the instance but if you haven't already started the user
instance with a managed code connection, ODBC won't start it. If your main
application is using ODBC, I would recommend attaching the database to the
main instance so it is always running and the ODBC connection can find it.
There is more information on named instances and how to connect to them
here:
http://msdn.microsoft.com/sql/express/default.aspx?pull=/library/en-us/dnsse/html/sqlexpuserinst.asp
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"sanjib" <sanjib@.discussions.microsoft.com> wrote in message
news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...
> Norman,
> There should be some way to connect to the SQl server 2005 Express user
> instance. I need to connect to this SQl server b'case one of my
> application
> is demandint that...There should be some way, tht we do not know...Anyway
> thanks...Someone pls guide me...
> Thanks,
> Sanjib
> --
> Sanjib Saha
>
> "sanjib" wrote:
>> Hi All,
>> Recently I have installed SQl server express edition. I was able to
>> connect
>> to the SQL server from my .NET project using connection parameter like:
>> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and
>> Settings\Raju\My
>> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
>> Security=True;Connect Timeout=30;User Instance=True
>> Now I need to connect to the same SQL server from 'ODBC Data Source
>> Aministrator' wizard, that I am unable to do. The wizard is asking me
>> (for
>> system DSn and File DSN) for SQL server name (I do no know what to give,
>> is
>> it (local) or something) and how to login authenticate (with windows
>> authentication or something). Now if I goto Services/SQl Server
>> (SQLEXPRESS)
>> , click LogOn I see that 'Local System Account' is checked. Pls tell me
>> how
>> to connect to this SQl server using System DSN connection wizard.
>> By the way I am the administrator of this machine where I have instlled
>> the
>> SQl server...
>> Thanks in advance,
>> --
>> Sanjib Saha|||I agree with Roger.
If you HAVE to access the database on SQL Server Express via something other
than ADO.NET2.0's System.Data SqlClient namespace, why use User Instannce?
The whole point of using user instance is to limit the database setup/access
within current user's privilidge of access to the computer. If a user has to
use ODBC DSN Wizard, it may well requires the user has a bit more privilidge
that usual. Also, an user instance is not available to other user even the
other user uses the same computer.
"sanjib" <sanjib@.discussions.microsoft.com> wrote in message
news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...
> Norman,
> There should be some way to connect to the SQl server 2005 Express user
> instance. I need to connect to this SQl server b'case one of my
> application
> is demandint that...There should be some way, tht we do not know...Anyway
> thanks...Someone pls guide me...
> Thanks,
> Sanjib
> --
> Sanjib Saha
>
> "sanjib" wrote:
>> Hi All,
>> Recently I have installed SQl server express edition. I was able to
>> connect
>> to the SQL server from my .NET project using connection parameter like:
>> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and
>> Settings\Raju\My
>> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
>> Security=True;Connect Timeout=30;User Instance=True
>> Now I need to connect to the same SQL server from 'ODBC Data Source
>> Aministrator' wizard, that I am unable to do. The wizard is asking me
>> (for
>> system DSn and File DSN) for SQL server name (I do no know what to give,
>> is
>> it (local) or something) and how to login authenticate (with windows
>> authentication or something). Now if I goto Services/SQl Server
>> (SQLEXPRESS)
>> , click LogOn I see that 'Local System Account' is checked. Pls tell me
>> how
>> to connect to this SQl server using System DSN connection wizard.
>> By the way I am the administrator of this machine where I have instlled
>> the
>> SQl server...
>> Thanks in advance,
>> --
>> Sanjib Saha|||Roger/Norman,
The whole point came like this. I am trying to install a SQl server driven
3rd party application and after the applications gets installed the database
installation wizard appears and tht wizard asks me to connect to the SQL
server using ODBC DSN, so I need to know the parameters for connecting to the
SQL server, which I don't know it seems, b'case while installing SQL server
2005 it never asked me for a server name/login password. And now it is
running using the 'Local System Account' i.e. Local Admin account that is me.
May be my SQL server 2005 is using user instance, although I am not sure.
The fact that I am not that much knowlegeble in SQL severs, much worked in
microsoft programming languages, and SQl server for me is a database server
tht always worked.
I will try from the URL provided by Roger and let u know...
Thanks,
Sanjib
--
Sanjib Saha
"Roger Wolter[MSFT]" wrote:
> You can access an User Instance once it is started by specifying the Named
> Pipe name for the instance but if you haven't already started the user
> instance with a managed code connection, ODBC won't start it. If your main
> application is using ODBC, I would recommend attaching the database to the
> main instance so it is always running and the ODBC connection can find it.
> There is more information on named instances and how to connect to them
> here:
> http://msdn.microsoft.com/sql/express/default.aspx?pull=/library/en-us/dnsse/html/sqlexpuserinst.asp
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "sanjib" <sanjib@.discussions.microsoft.com> wrote in message
> news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...
> > Norman,
> >
> > There should be some way to connect to the SQl server 2005 Express user
> > instance. I need to connect to this SQl server b'case one of my
> > application
> > is demandint that...There should be some way, tht we do not know...Anyway
> > thanks...Someone pls guide me...
> >
> > Thanks,
> > Sanjib
> > --
> > Sanjib Saha
> >
> >
> > "sanjib" wrote:
> >
> >> Hi All,
> >>
> >> Recently I have installed SQl server express edition. I was able to
> >> connect
> >> to the SQL server from my .NET project using connection parameter like:
> >>
> >> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and
> >> Settings\Raju\My
> >> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
> >> Security=True;Connect Timeout=30;User Instance=True
> >>
> >> Now I need to connect to the same SQL server from 'ODBC Data Source
> >> Aministrator' wizard, that I am unable to do. The wizard is asking me
> >> (for
> >> system DSn and File DSN) for SQL server name (I do no know what to give,
> >> is
> >> it (local) or something) and how to login authenticate (with windows
> >> authentication or something). Now if I goto Services/SQl Server
> >> (SQLEXPRESS)
> >> , click LogOn I see that 'Local System Account' is checked. Pls tell me
> >> how
> >> to connect to this SQl server using System DSN connection wizard.
> >>
> >> By the way I am the administrator of this machine where I have instlled
> >> the
> >> SQl server...
> >>
> >> Thanks in advance,
> >> --
> >> Sanjib Saha
>
>|||From your description in this post, it seems your installation does not
install an user instance (I am not sure). However, form your first post,
according to the ConnectionString, you are trying to use an User Instance.
User Instance of SQL Server Express is a special installation of SQL Server
Express. It seems you need a bit more study on what an user instance is, so
that you can tell if your intallation is an user instance or not, and
whether you need an user instance or not. IMO, SQL Server Express's user
instance does not go with ODBC.
"sanjib" <sanjib@.discussions.microsoft.com> wrote in message
news:33A10BC3-2103-4BD3-B9E7-5AE71965D745@.microsoft.com...
> Roger/Norman,
> The whole point came like this. I am trying to install a SQl server driven
> 3rd party application and after the applications gets installed the
> database
> installation wizard appears and tht wizard asks me to connect to the SQL
> server using ODBC DSN, so I need to know the parameters for connecting to
> the
> SQL server, which I don't know it seems, b'case while installing SQL
> server
> 2005 it never asked me for a server name/login password. And now it is
> running using the 'Local System Account' i.e. Local Admin account that is
> me.
> May be my SQL server 2005 is using user instance, although I am not sure.
> The fact that I am not that much knowlegeble in SQL severs, much worked in
> microsoft programming languages, and SQl server for me is a database
> server
> tht always worked.
> I will try from the URL provided by Roger and let u know...
> Thanks,
> Sanjib
> --
> Sanjib Saha
>
> "Roger Wolter[MSFT]" wrote:
>> You can access an User Instance once it is started by specifying the
>> Named
>> Pipe name for the instance but if you haven't already started the user
>> instance with a managed code connection, ODBC won't start it. If your
>> main
>> application is using ODBC, I would recommend attaching the database to
>> the
>> main instance so it is always running and the ODBC connection can find
>> it.
>> There is more information on named instances and how to connect to them
>> here:
>> http://msdn.microsoft.com/sql/express/default.aspx?pull=/library/en-us/dnsse/html/sqlexpuserinst.asp
>>
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> Use of included script samples are subject to the terms specified at
>> http://www.microsoft.com/info/cpyright.htm
>> "sanjib" <sanjib@.discussions.microsoft.com> wrote in message
>> news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...
>> > Norman,
>> >
>> > There should be some way to connect to the SQl server 2005 Express user
>> > instance. I need to connect to this SQl server b'case one of my
>> > application
>> > is demandint that...There should be some way, tht we do not
>> > know...Anyway
>> > thanks...Someone pls guide me...
>> >
>> > Thanks,
>> > Sanjib
>> > --
>> > Sanjib Saha
>> >
>> >
>> > "sanjib" wrote:
>> >
>> >> Hi All,
>> >>
>> >> Recently I have installed SQl server express edition. I was able to
>> >> connect
>> >> to the SQL server from my .NET project using connection parameter
>> >> like:
>> >>
>> >> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and
>> >> Settings\Raju\My
>> >> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
>> >> Security=True;Connect Timeout=30;User Instance=True
>> >>
>> >> Now I need to connect to the same SQL server from 'ODBC Data Source
>> >> Aministrator' wizard, that I am unable to do. The wizard is asking me
>> >> (for
>> >> system DSn and File DSN) for SQL server name (I do no know what to
>> >> give,
>> >> is
>> >> it (local) or something) and how to login authenticate (with windows
>> >> authentication or something). Now if I goto Services/SQl Server
>> >> (SQLEXPRESS)
>> >> , click LogOn I see that 'Local System Account' is checked. Pls tell
>> >> me
>> >> how
>> >> to connect to this SQl server using System DSN connection wizard.
>> >>
>> >> By the way I am the administrator of this machine where I have
>> >> instlled
>> >> the
>> >> SQl server...
>> >>
>> >> Thanks in advance,
>> >> --
>> >> Sanjib Saha
>>|||I think I may understand what you're asking now. You have two completely
unrelated elements in your posting. First you were able to use ADO.Net in
Visual Studio to create a database. This database was a user instance which
is why this came up in our answers. On a completely unrelated note you now
want to install a third party application that uses ODBC to connect to the
database.
Go into the Windows Control Panel and select Administrative Tools. One of
the tools is ODBC data sources. Select the System DSN or User DSN as
required for your application and click ADD. Select the SQL Native Client
Driver. Fill in a name which you get to choose (probably the application is
looking for a particular name), leave the description blank and put
.\SQLExpress in the server field. Select the defaults for the rest unless
you already know the database name you want to make your default database.
If not, the default will be "master".
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Norman Yuan" <NotReal@.NotReal.not> wrote in message
news:eQyQnkToGHA.956@.TK2MSFTNGP03.phx.gbl...
>I agree with Roger.
> If you HAVE to access the database on SQL Server Express via something
> other than ADO.NET2.0's System.Data SqlClient namespace, why use User
> Instannce? The whole point of using user instance is to limit the database
> setup/access within current user's privilidge of access to the computer.
> If a user has to use ODBC DSN Wizard, it may well requires the user has a
> bit more privilidge that usual. Also, an user instance is not available to
> other user even the other user uses the same computer.
>
> "sanjib" <sanjib@.discussions.microsoft.com> wrote in message
> news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...
>> Norman,
>> There should be some way to connect to the SQl server 2005 Express user
>> instance. I need to connect to this SQl server b'case one of my
>> application
>> is demandint that...There should be some way, tht we do not
>> know...Anyway
>> thanks...Someone pls guide me...
>> Thanks,
>> Sanjib
>> --
>> Sanjib Saha
>>
>> "sanjib" wrote:
>> Hi All,
>> Recently I have installed SQl server express edition. I was able to
>> connect
>> to the SQL server from my .NET project using connection parameter like:
>> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and
>> Settings\Raju\My
>> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
>> Security=True;Connect Timeout=30;User Instance=True
>> Now I need to connect to the same SQL server from 'ODBC Data Source
>> Aministrator' wizard, that I am unable to do. The wizard is asking me
>> (for
>> system DSn and File DSN) for SQL server name (I do no know what to give,
>> is
>> it (local) or something) and how to login authenticate (with windows
>> authentication or something). Now if I goto Services/SQl Server
>> (SQLEXPRESS)
>> , click LogOn I see that 'Local System Account' is checked. Pls tell me
>> how
>> to connect to this SQl server using System DSN connection wizard.
>> By the way I am the administrator of this machine where I have instlled
>> the
>> SQl server...
>> Thanks in advance,
>> --
>> Sanjib Saha
>|||Roger/Norman,
Roger's trick to connect to the SQL server worked for me, I was able to use
the ODBC data source wizard to connect to the SQL server. It worked for me.
Now I will be happy if this SQL server let me create a user (for this SQL
server) for me, at least one user with all the DBA permission. Is tht
possible, pls let me know...
By the time I have started reading some materials for SQL server. ANother
thing with this SQL server 2005 express, there is no SQl explore window where
I can find create the SQL server Datavase/queries etc. Why is it so.
Although many thanks for your kind help and suggestions...
Sanjib
--
Sanjib Saha
"Roger Wolter[MSFT]" wrote:
> I think I may understand what you're asking now. You have two completely
> unrelated elements in your posting. First you were able to use ADO.Net in
> Visual Studio to create a database. This database was a user instance which
> is why this came up in our answers. On a completely unrelated note you now
> want to install a third party application that uses ODBC to connect to the
> database.
> Go into the Windows Control Panel and select Administrative Tools. One of
> the tools is ODBC data sources. Select the System DSN or User DSN as
> required for your application and click ADD. Select the SQL Native Client
> Driver. Fill in a name which you get to choose (probably the application is
> looking for a particular name), leave the description blank and put
> ..\SQLExpress in the server field. Select the defaults for the rest unless
> you already know the database name you want to make your default database.
> If not, the default will be "master".
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Norman Yuan" <NotReal@.NotReal.not> wrote in message
> news:eQyQnkToGHA.956@.TK2MSFTNGP03.phx.gbl...
> >I agree with Roger.
> >
> > If you HAVE to access the database on SQL Server Express via something
> > other than ADO.NET2.0's System.Data SqlClient namespace, why use User
> > Instannce? The whole point of using user instance is to limit the database
> > setup/access within current user's privilidge of access to the computer.
> > If a user has to use ODBC DSN Wizard, it may well requires the user has a
> > bit more privilidge that usual. Also, an user instance is not available to
> > other user even the other user uses the same computer.
> >
> >
> > "sanjib" <sanjib@.discussions.microsoft.com> wrote in message
> > news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...
> >> Norman,
> >>
> >> There should be some way to connect to the SQl server 2005 Express user
> >> instance. I need to connect to this SQl server b'case one of my
> >> application
> >> is demandint that...There should be some way, tht we do not
> >> know...Anyway
> >> thanks...Someone pls guide me...
> >>
> >> Thanks,
> >> Sanjib
> >> --
> >> Sanjib Saha
> >>
> >>
> >> "sanjib" wrote:
> >>
> >> Hi All,
> >>
> >> Recently I have installed SQl server express edition. I was able to
> >> connect
> >> to the SQL server from my .NET project using connection parameter like:
> >>
> >> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and
> >> Settings\Raju\My
> >> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
> >> Security=True;Connect Timeout=30;User Instance=True
> >>
> >> Now I need to connect to the same SQL server from 'ODBC Data Source
> >> Aministrator' wizard, that I am unable to do. The wizard is asking me
> >> (for
> >> system DSn and File DSN) for SQL server name (I do no know what to give,
> >> is
> >> it (local) or something) and how to login authenticate (with windows
> >> authentication or something). Now if I goto Services/SQl Server
> >> (SQLEXPRESS)
> >> , click LogOn I see that 'Local System Account' is checked. Pls tell me
> >> how
> >> to connect to this SQl server using System DSN connection wizard.
> >>
> >> By the way I am the administrator of this machine where I have instlled
> >> the
> >> SQl server...
> >>
> >> Thanks in advance,
> >> --
> >> Sanjib Saha
> >
> >
>
>|||You can download Sql Server Management Studio Express (free) from MS and it
is desinged for managing SQL Server /Express,
"sanjib" <sanjib@.discussions.microsoft.com> wrote in message
news:7AC96FD6-B69E-4A90-8CB7-C5151A5BD193@.microsoft.com...
> Roger/Norman,
> Roger's trick to connect to the SQL server worked for me, I was able to
> use
> the ODBC data source wizard to connect to the SQL server. It worked for
> me.
> Now I will be happy if this SQL server let me create a user (for this SQL
> server) for me, at least one user with all the DBA permission. Is tht
> possible, pls let me know...
> By the time I have started reading some materials for SQL server. ANother
> thing with this SQL server 2005 express, there is no SQl explore window
> where
> I can find create the SQL server Datavase/queries etc. Why is it so.
> Although many thanks for your kind help and suggestions...
> Sanjib
> --
> Sanjib Saha
>
> "Roger Wolter[MSFT]" wrote:
>> I think I may understand what you're asking now. You have two completely
>> unrelated elements in your posting. First you were able to use ADO.Net
>> in
>> Visual Studio to create a database. This database was a user instance
>> which
>> is why this came up in our answers. On a completely unrelated note you
>> now
>> want to install a third party application that uses ODBC to connect to
>> the
>> database.
>> Go into the Windows Control Panel and select Administrative Tools. One
>> of
>> the tools is ODBC data sources. Select the System DSN or User DSN as
>> required for your application and click ADD. Select the SQL Native
>> Client
>> Driver. Fill in a name which you get to choose (probably the application
>> is
>> looking for a particular name), leave the description blank and put
>> ..\SQLExpress in the server field. Select the defaults for the rest
>> unless
>> you already know the database name you want to make your default
>> database.
>> If not, the default will be "master".
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> Use of included script samples are subject to the terms specified at
>> http://www.microsoft.com/info/cpyright.htm
>> "Norman Yuan" <NotReal@.NotReal.not> wrote in message
>> news:eQyQnkToGHA.956@.TK2MSFTNGP03.phx.gbl...
>> >I agree with Roger.
>> >
>> > If you HAVE to access the database on SQL Server Express via something
>> > other than ADO.NET2.0's System.Data SqlClient namespace, why use User
>> > Instannce? The whole point of using user instance is to limit the
>> > database
>> > setup/access within current user's privilidge of access to the
>> > computer.
>> > If a user has to use ODBC DSN Wizard, it may well requires the user has
>> > a
>> > bit more privilidge that usual. Also, an user instance is not available
>> > to
>> > other user even the other user uses the same computer.
>> >
>> >
>> > "sanjib" <sanjib@.discussions.microsoft.com> wrote in message
>> > news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...
>> >> Norman,
>> >>
>> >> There should be some way to connect to the SQl server 2005 Express
>> >> user
>> >> instance. I need to connect to this SQl server b'case one of my
>> >> application
>> >> is demandint that...There should be some way, tht we do not
>> >> know...Anyway
>> >> thanks...Someone pls guide me...
>> >>
>> >> Thanks,
>> >> Sanjib
>> >> --
>> >> Sanjib Saha
>> >>
>> >>
>> >> "sanjib" wrote:
>> >>
>> >> Hi All,
>> >>
>> >> Recently I have installed SQl server express edition. I was able to
>> >> connect
>> >> to the SQL server from my .NET project using connection parameter
>> >> like:
>> >>
>> >> Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and
>> >> Settings\Raju\My
>> >> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
>> >> Security=True;Connect Timeout=30;User Instance=True
>> >>
>> >> Now I need to connect to the same SQL server from 'ODBC Data Source
>> >> Aministrator' wizard, that I am unable to do. The wizard is asking me
>> >> (for
>> >> system DSn and File DSN) for SQL server name (I do no know what to
>> >> give,
>> >> is
>> >> it (local) or something) and how to login authenticate (with windows
>> >> authentication or something). Now if I goto Services/SQl Server
>> >> (SQLEXPRESS)
>> >> , click LogOn I see that 'Local System Account' is checked. Pls tell
>> >> me
>> >> how
>> >> to connect to this SQl server using System DSN connection wizard.
>> >>
>> >> By the way I am the administrator of this machine where I have
>> >> instlled
>> >> the
>> >> SQl server...
>> >>
>> >> Thanks in advance,
>> >> --
>> >> Sanjib Saha
>> >
>> >
>>
How to connect to the SQl server EXPRESS using 'ODBC Data Source A
Recently I have installed SQl server express edition. I was able to connect
to the SQL server from my .NET project using connection parameter like:
Data Source=. \SQLEXPRESS;AttachDbFilename=C:\Document
s and Settings\Raju\My
Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
Security=True;Connect Timeout=30;User Instance=True
Now I need to connect to the same SQL server from 'ODBC Data Source
Aministrator' wizard, that I am unable to do. The wizard is asking me (for
system DSn and File DSN) for SQL server name (I do no know what to give, is
it (local) or something) and how to login authenticate (with windows
authentication or something). Now if I goto Services/SQl Server (SQLEXPRESS)
, click LogOn I see that 'Local System Account' is checked. Pls tell me how
to connect to this SQl server using System DSN connection wizard.
By the way I am the administrator of this machine where I have instlled the
SQl server...
Thanks in advance,
--
Sanjib SahaHi
VB.NET
Imports System.Data.Odbc
Dim oODBCConnection As OdbcConnection
Dim ConnString As String = _
"Driver={SQL Server};" & _
"Server=SQLServerName;" & _
"Database=DatabaseName;" & _
"Uid=Username;" & _
"Pwd=Password"
oODBCConnection = New Odbc.OdbcConnection(ConnString)
oODBCConnection.Open()
"sanjib" <sanjib@.discussions.microsoft.com> wrote in message
news:7BE14AB4-9460-4489-B7CB-62880592EFC6@.microsoft.com...
> Hi All,
> Recently I have installed SQl server express edition. I was able to
> connect
> to the SQL server from my .NET project using connection parameter like:
> Data Source=. \SQLEXPRESS;AttachDbFilename=C:\Document
s and
> Settings\Raju\My
> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
> Security=True;Connect Timeout=30;User Instance=True
> Now I need to connect to the same SQL server from 'ODBC Data Source
> Aministrator' wizard, that I am unable to do. The wizard is asking me (for
> system DSn and File DSN) for SQL server name (I do no know what to give,
> is
> it (local) or something) and how to login authenticate (with windows
> authentication or something). Now if I goto Services/SQl Server
> (SQLEXPRESS)
> , click LogOn I see that 'Local System Account' is checked. Pls tell me
> how
> to connect to this SQl server using System DSN connection wizard.
> By the way I am the administrator of this machine where I have instlled
> the
> SQl server...
> Thanks in advance,
> --
> Sanjib Saha|||The OP indicates that he is using SQL Server 2005 Express' User Instance. I
do not think he can connect to User Instance through ODBC DSN Wizard (why
use ODBC anyway?). I am not should if it is possible to connect to SQL
Server Express' User Instance through OdbcConnection object in
System.Data.Odbc namespace, but it is certain your sample code will not.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23QvKqzLoGHA.4332@.TK2MSFTNGP03.phx.gbl...
> Hi
> VB.NET
> Imports System.Data.Odbc
> Dim oODBCConnection As OdbcConnection
> Dim ConnString As String = _
> "Driver={SQL Server};" & _
> "Server=SQLServerName;" & _
> "Database=DatabaseName;" & _
> "Uid=Username;" & _
> "Pwd=Password"
> oODBCConnection = New Odbc.OdbcConnection(ConnString)
> oODBCConnection.Open()
>
> "sanjib" <sanjib@.discussions.microsoft.com> wrote in message
> news:7BE14AB4-9460-4489-B7CB-62880592EFC6@.microsoft.com...
>|||Norman,
There should be some way to connect to the SQl server 2005 Express user
instance. I need to connect to this SQl server b'case one of my application
is demandint that...There should be some way, tht we do not know...Anyway
thanks...Someone pls guide me...
Thanks,
Sanjib
--
Sanjib Saha
"sanjib" wrote:
> Hi All,
> Recently I have installed SQl server express edition. I was able to connec
t
> to the SQL server from my .NET project using connection parameter like:
> Data Source=. \SQLEXPRESS;AttachDbFilename=C:\Document
s and Settings\Raju\M
y
> Documents\Sanjib SQL DBs\IBuyAdventure\IBuyAdventure.mdf;Integrated
> Security=True;Connect Timeout=30;User Instance=True
> Now I need to connect to the same SQL server from 'ODBC Data Source
> Aministrator' wizard, that I am unable to do. The wizard is asking me (for
> system DSn and File DSN) for SQL server name (I do no know what to give, i
s
> it (local) or something) and how to login authenticate (with windows
> authentication or something). Now if I goto Services/SQl Server (SQLEXPRES
S)
> , click LogOn I see that 'Local System Account' is checked. Pls tell me ho
w
> to connect to this SQl server using System DSN connection wizard.
> By the way I am the administrator of this machine where I have instlled th
e
> SQl server...
> Thanks in advance,
> --
> Sanjib Saha|||You can access an User Instance once it is started by specifying the Named
Pipe name for the instance but if you haven't already started the user
instance with a managed code connection, ODBC won't start it. If your main
application is using ODBC, I would recommend attaching the database to the
main instance so it is always running and the ODBC connection can find it.
There is more information on named instances and how to connect to them
here:
http://msdn.microsoft.com/sql/expre...expuserinst.asp
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"sanjib" <sanjib@.discussions.microsoft.com> wrote in message
news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...[vbcol=seagreen]
> Norman,
> There should be some way to connect to the SQl server 2005 Express user
> instance. I need to connect to this SQl server b'case one of my
> application
> is demandint that...There should be some way, tht we do not know...Anyway
> thanks...Someone pls guide me...
> Thanks,
> Sanjib
> --
> Sanjib Saha
>
> "sanjib" wrote:
>|||I agree with Roger.
If you HAVE to access the database on SQL Server Express via something other
than ADO.NET2.0's System.Data SqlClient namespace, why use User Instannce?
The whole point of using user instance is to limit the database setup/access
within current user's privilidge of access to the computer. If a user has to
use ODBC DSN Wizard, it may well requires the user has a bit more privilidge
that usual. Also, an user instance is not available to other user even the
other user uses the same computer.
"sanjib" <sanjib@.discussions.microsoft.com> wrote in message
news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...[vbcol=seagreen]
> Norman,
> There should be some way to connect to the SQl server 2005 Express user
> instance. I need to connect to this SQl server b'case one of my
> application
> is demandint that...There should be some way, tht we do not know...Anyway
> thanks...Someone pls guide me...
> Thanks,
> Sanjib
> --
> Sanjib Saha
>
> "sanjib" wrote:
>|||I think I may understand what you're asking now. You have two completely
unrelated elements in your posting. First you were able to use ADO.Net in
Visual Studio to create a database. This database was a user instance which
is why this came up in our answers. On a completely unrelated note you now
want to install a third party application that uses ODBC to connect to the
database.
Go into the Windows Control Panel and select Administrative Tools. One of
the tools is ODBC data sources. Select the System DSN or User DSN as
required for your application and click ADD. Select the SQL Native Client
Driver. Fill in a name which you get to choose (probably the application is
looking for a particular name), leave the description blank and put
.\SQLExpress in the server field. Select the defaults for the rest unless
you already know the database name you want to make your default database.
If not, the default will be "master".
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Norman Yuan" <NotReal@.NotReal.not> wrote in message
news:eQyQnkToGHA.956@.TK2MSFTNGP03.phx.gbl...
>I agree with Roger.
> If you HAVE to access the database on SQL Server Express via something
> other than ADO.NET2.0's System.Data SqlClient namespace, why use User
> Instannce? The whole point of using user instance is to limit the database
> setup/access within current user's privilidge of access to the computer.
> If a user has to use ODBC DSN Wizard, it may well requires the user has a
> bit more privilidge that usual. Also, an user instance is not available to
> other user even the other user uses the same computer.
>
> "sanjib" <sanjib@.discussions.microsoft.com> wrote in message
> news:2AB671B3-FEAD-49C9-A309-8DBF8BF07815@.microsoft.com...
>
Monday, March 26, 2012
How to connect to ODBC data source through C#. net
I am doing an application which takes the DSN name from user in text
box and then open the ODBC data source dialog box. i.e. I want the
(ODBC data source administrator) form which comes after clicking on
ODBC data source icon in administrative tools.
Now my problem is that is it possible to call that system form
(utility) through my program or I have to design the same form (ODBC
data source administrator).
If I can call that form then please tell me how....i can do that?
Any help will be appreciated.
Thanks
DineshYou would be better off posting this in a C# newsgroup. This is for
Reporting Services.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Dinesh" <dinesht15@.gmail.com> wrote in message
news:1166091132.509799.4510@.f1g2000cwa.googlegroups.com...
> Hi experts,
> I am doing an application which takes the DSN name from user in text
> box and then open the ODBC data source dialog box. i.e. I want the
> (ODBC data source administrator) form which comes after clicking on
> ODBC data source icon in administrative tools.
> Now my problem is that is it possible to call that system form
> (utility) through my program or I have to design the same form (ODBC
> data source administrator).
> If I can call that form then please tell me how....i can do that?
> Any help will be appreciated.
> Thanks
> Dinesh
>
Friday, March 23, 2012
How to connect Oracle Data Source for Reporting Service
I have the problem to connect Oracle data for my Report designer.
1st I used ODBC, it does not work, and my reference book "MS SQL server 2000 Reporting service step by step" tells me that I must select Oracle data provide instead of the generic ODBC.
I created a new data source and after I enter the userId/pswd and click "Test Connection" button, it is OK. But when I click "run" icon to try, it gives me the following error messages:
An error occurred while executing the query, ORA-00936:Missing expression
Additiona information:
ORA-00936:missing expression(system.Data.OracleClient)
My version of reporting service is 2005. The setting of "Connection Properties" as follows:
Data Source: Oracle (OracleClient) Server name: creonpra Log On to the database: UserId/Pswd= qmprodviewer/*********
I have very less knowledge about Oracle. I do not know Oracle Client software's coverage. I checked my program and only find Oracle 8i of "Net8 Assistant", "Net8 Config Assistant" and Oracle ODBC test" on my desktop PC.
Please help me to resolve the problem
Hi,
This looks like a query syntax error.
Did you use the query builder to create your Oracle query?
If you paste your query in a new database project can you execute it?
I would recommand to use the database project or Toad to debug the query, then when it is working, paste it back to your report dataset.
Philippe
|||Yes definitely a syntax problem. Along with the other suggestion of trying it in the Oracle also try simple expressions first like...
select * from Table1
etc.
If your still stuck past the Syntax here and I can have a look at it since I connect primarily to Oracle DB's using the Oracle connection.
Craig
Wednesday, March 21, 2012
how to connect in mysql odbc 3.5 using crystal report 9.0
Is there anyone who can help me pls.
sweet_babylhyn@.yahoo.com
Thankx!!!!Have you tried connecting via OLEDB provider for ODBC?
Are you able to connect to your ODBC from some other application, say, Microsoft Excel?|||Yes, I can create connection using ODBC in SQL SERVER 2005 or in MS-Access but in MYSQL ODBC 3.51 i can't... The connection is succeded but when i click the connection(odbc name), no items found. What should i do?
But when i used the odbc name in visual basic 6.0, it works but in crystal report 9.0, it did not.
Thanx for the reply...|||sorry, SQL SERVER 2000.|||Please apply the latest service pack for CR9.
http://support.businessobjects.com/library/kbase/articles/c2013269.asp
BTW, in most cases, scanning the Crystal knowledge base will get you your answer much sooner than posting to discussion forum.|||Thanx a lot... it works. How about viewing the rpt's in web. I use php in my application. Is their any rpt viewer for php?
Thanx again...|||There are tons of questions like that in Crystal discussion forum at businessobjects.com
To put it briefly, the PHP is multiplatform, but Crystal is not. That means, no direct support for viewing over web via PHP. However, you can use RDC to generate HTML or PDF files and pass them to the client. But only if you run on Windows.
Some people have been experimenting with converting Crystal JSP files to PHP, but I don't know if they have succeeded.
How to connect Analysis Services to Netezza?
HI,
Netezza is ODBC compliant data warehousing applicance. There seems no way to connect SSAS to Netezza as SSAS does not support ODBC data sources.
Has any body ever tried it? Please provide any feedback, comments etc.
Thanks
Saeed
SSAS will allow you to connect through .Net providers or OLEDB providers, so you have 2 choices
1) ODBC .Net Provider http://www.microsoft.com/downloads/details.aspx?familyid=6ccd8427-1017-4f33-a062-d165078e32b1&displaylang=en
2) There is an "OLEDB Provider for ODBC", this used to be part of MDAC, I know it was in MDAC 2.7, but I have not used it since then. I think MDAC is currently at 2.8 SP1 http://www.microsoft.com/downloads/details.aspx?familyid=78CAC895-EFC2-4F8E-A9E0-3A1AFBD5922E&displaylang=en
Also from what I can see there appears to be atleast one 3rd party company offering OLEDB to ODBC "bridge" drivers.
sqlHow to connect a workstation to SQL Server 2005 thru ODBC?
on a Windows 2003 Standard Server. SQL Server Service is running under local
system account. I have not changed any default setting.
I want to set up a System DSN in ODBC Data Source Administrator on a Windows
XP SP2 machine to connect to the SQL Server 2005 named instance. But I get
the message Specified SQL Server not found. I have no problem in setting up
System DSN to connect to SQL Server 2000 named instances which is in another
Windows 2003 Standard Server. I have not installed anything from SQL Server
2005 onto the Windows XP machine.
Thanks for any help.
You didn't mention if the connection attempt was from the same computer. If
you are connecting from a different computer, you probably need to use the
Surface Area Configuration tool, and open the port in the Windows XP
firewall. This tutorial may help you.
Getting Started with the Database Engine
Welcome to the Getting Started with the Database Engine tutorial. This
tutorial is intended for users who are new to SQL Server 2005 and who have
installed Developer, Express, or Evaluation Edition on a computer running
Windows XP Professional Service Pack 1 (SP1).This brief tutorial helps you
get started using the Database Engine.
What You Will Learn
This tutorial shows you how to connect to the Database Engine using SQL
Server Management Studio or Management Studio Express, on both the local
computer and from another computer.
This tutorial is divided into two lessons:
Lesson 1: Connecting to the Database Engine
In this lesson, you will learn how to connect to the Database Engine and
enable additional people to connect.
Lesson 2: Connecting from Another Computer
In this lesson, you will learn how to connect to the Database Engine from a
second computer, including enabling protocols, configuring ports, and
configuring firewall settings.
Requirements
This lesson has no knowledge prerequisites.
Your system must have the following installed to use this tutorial:
a.. Internet Explorer 6.0 or later.
b.. Either SQL Server Management Studio or Management Studio Express.
Lesson 1: Connecting to the Database Engine
When you install the SQL Server 2005 Database Engine, the tools that are
installed depend upon the edition and your setup choices. This lesson
reviews the principal tools, and shows you how to connect and perform a
basic function (authorizing more users).
This lesson contains the following topics:
a.. Tools for Getting Started
b.. Connecting with Management Studio
c.. Authorizing Additional Connections
Tools for Getting Started
The SQL Server 2005 Database Engine ships with a variety of tools. This
topic describes the first tools you will need, and helps you select the
right tool for the job. All tools can be accessed from the Start menu.
Generally, tools such as SQL Server Management Studio are not installed by
default. You must select the tools as part of the client components during
setup. For complete description of the tools described below, search for
them in Books Online. SQL Server 2005 Express Edition contains only a subset
of the tools.
Basic Tools
a.. SQL Server Management Studio is the principal tool for administering
the Database Engine and writing Transact-SQL code. It is hosted in the
Visual Studio shell. It is not included in SQL Server 2005 Express Edition
or SQL Server 2005 Mobile Edition.
b.. SQL Server Management Studio Express is a free, limited version of SQL
Server Management Studio, intended for use with SQL Server 2005 Express
Edition and for users who want the basic features of Management Studio in a
lightweight tool.
c.. SQL Server Surface Area Configuration installs with SQL Server and
lets you enable the server protocols, configure services to start
automatically, and enable some optional features of the Database Engine.
d.. SQL Server Configuration Manager installs with both SQL Server and the
client tools. It lets you enable server protocols, configure protocol
options such as TCP ports, configure server services to start automatically,
and configure client computers to connect in your preferred manner.
Sample Database
SQL Server 2005 includes a sample database called AdventureWorks. This
database is not installed by default. If you wish to experiment with the
AdventureWorks database, you must select it using the Setup program. Most
examples described in Books Online use the AdventureWorks database. For more
information, see Running Setup to Install AdventureWorks Sample Databases
and Samples.
To start SQL Server Management Studio
1. On the Start menu, point to All Programs, point to Microsoft SQL
Server 2005, and then click SQL Server Management Studio.
To start SQL Server Surface Area Configuration or SQL Server Configuration
Manager
1. On the Start menu, point to All Programs, point to Microsoft SQL
Server 2005, point to Configuration Tools, and then click either SQL Server
Surface Area Configuration or SQL Server Configuration Manager.
Connecting with Management Studio
It is easy to connect to the Database Engine from tools running on the same
computer if you know the name of the instance, and if you are connecting as
a member of the Administrators group on the computer. The following
procedures must be performed on the same computer that hosts SQL Server.
To determine the name of the Database Engine instance
1. Log into Windows as a member of the Administrators group, and open
either Management Studio or Management Studio Express Edition.
The Connect to Server dialog box opens.
2. Click Cancel.
3. If Registered Servers is not displayed, on the View menu, click
Registered Servers.
4. With Database Engine selected on the Registered Servers toolbar,
right-click Database Engine, and then click Update Local Server
Registration. All instances of the Database Engine installed on the computer
are displayed. This includes instances of SQL Server 2000. Management Studio
can connect and manage instances of SQL Server 2000 as well as SQL Server
2005. The default instance is unnamed and is shown as the computer name. A
named instance displays as the computer name followed by a backward slash
(\) and then the name of the instance. For SQL Server 2005 Express Edition,
the instance is named <computer_name>\sqlexpress unless the name was changed
during setup.
To verify that the Database Engine is running
1. In Registered Servers, if the name of your instance of SQL Server
has a green dot with a white arrow next to the name, the Database Engine is
running and no further action is necessary.
2. If the name of your instance of SQL Server has a red dot with a
white square next to the name, the Database Engine is stopped. Right-click
the name of the Database Engine, and then click Start. After a confirmation
dialog box, the Database Engine should start and the circle should turn
green.
To connect to the Database Engine
1. On the File menu, click Connect Object Explorer.
The Connect to Server dialog box opens. The Server type box displays the
type that was last used.
2. Select Database Engine.
3. In the Server name box, type the name of the Database Engine
instance.
4. Click Connect.
Authorizing Additional Connections
Now that you have connected to SQL Server as an administrator, one of your
first tasks is to authorize other users to connect. You do this by creating
a login and authorizing that login to access a database as a user. Logins
can be either Windows Authentication logins, which use your Windows
credentials, or SQL Server Authentication logins, which store the
authentication information in SQL Server and are independent of your network
credentials. Use Windows Authentication whenever possible.
Create a Windows Authentication login
1. In the previous task, you connected to the Database Engine using
Management Studio. In Object Explorer, expand your server instance, expand
Security, right-click Logins, and then click New Login.
The Login - New dialog box appears.
2. On the General page, in the Login name box, type a Windows login in
the format <domain>\<login>.
3. In the Default database box, select AdventureWorks if available.
Otherwise select master.
4. On the Server Roles page, if the new login is to be an
administrator, click sysadmin, otherwise leave this blank.
5. On the User Mapping page, select Map for the AdventureWorks
database if it is available. Otherwise select master. Note that the User box
is populated with the login. When closed, the dialog box will create this
user in the database.
6. In the Default Schema box, type dbo to map the login to the
database administrator schema.
7. Accept the default settings for the Securables and Status boxes and
click OK to create the login.
Note:
This is basic information to get you started. SQL Server provides a
rich security environment, and security is obviously an important aspect of
database operations. For more information about security, read the security
sections of Books Online, starting with Security Considerations for
Databases and Database Applications.
Lesson 2: Connecting from Another Computer
To enhance security, the Database Engine of SQL Server 2005 Developer,
Express, and Evaluation Editions cannot be accessed from another computer
when initially installed. This lesson shows you how to enable the protocols,
configure the ports, and configure the Windows Firewall for connecting from
other computers.
This lesson contains the following topics:
a.. Enabling Protocols
b.. Configuring a Fixed Port
c.. Opening Ports in the Firewall
d.. Connecting to the Database Engine from Another Computer
e.. Connecting Using the SQL Server Browser Service
Enabling Protocols
To enhance security, SQL Server 2005 Express Edition Developer Edition and
Evaluation Edition install with only limited network connectivity.
Connections to the Database Engine can be made from tools running the same
computer, but not from other computers. If you are planning to do your
development work on the same computer as the Database Engine, you're done.
Management Studio or Management Studio Express Edition will connect to the
Database Engine using the shared memory protocol, which is already enabled.
If you plan to connect to the Database Engine from another computer, you
must enable a protocol, such as TCP/IP.
How to enable TCP/IP connections from another computer
1. Start SQL Server Surface Area Configuration, and click Surface Area
Configuration for Services.
2. In the Surface Area Configuration for Services and Connections box,
the View by Instance box lists the instances of the Database Engine
installed on the computer. The default instance (an unnamed instance) is
listed as MSSQLSERVER. If you installed a named instance, the name you
provided is listed. SQL Server 2005 Express Edition installs as SQLEXPRESS
unless you changed the name during setup. In the View by Instance box,
expand the instance you wish to configure, expand Database Engine, and then
click Remote Connections.
3. Click Local and remote connections, click Using TCP/IP only, then
click OK and close the tool.
Configuring a Fixed Port
To enhance security, Windows XP Professional Service Pack 2 (SP2) turns on
the Windows Firewall. When SQL Server 2005 Developer, Express, or Evaluation
Edition is running on Windows XP Professional, and you wish to connect to it
from another computer, you must open a communication port in the firewall.
The default instance of the Database Engine listens on port 1433, so you do
not need to configure a fixed port, but named instances including SQL Server
2005 Express Edition listen on dynamic ports. Before you can open a port in
the firewall, you must first configure the Database Engine to listen on a
specific port; otherwise the Database Engine may listen on a different port
each time it is started.
Configure SQL Server to listen on a specific port
1. In SQL Server Configuration Manager, expand SQL Server 2005 Network
Configuration, and then click on the server instance you wish to configure.
2. In the right pane, double-click TCP/IP.
3. In the TCP/IP Properties dialog box, click the IP Addresses tab.
4. In the TCP Port box of the IPAll section, type an available port
number. For this tutorial, we will use 1500.
5. Click OK to close the dialog box, and click OK to the warning that
the service must be restarted.
6. In the left pane, click SQL Server 2005 Services.
7. In the right pane, right-click the instance of SQL Server, and then
click Restart. When the Database Engine restarts, it will listen on port
1500.
Opening Ports in the Firewall
Firewall systems prevent unauthorized access to computer resources. To
enhance security, Windows XP Professional Service Pack 2 (SP2) turns on
Windows Firewall. To connect to SQL Server from another computer, you must
open a port in the firewall.
Important:
Opening ports in your firewall can leave your server exposed to
malicious attacks. Be sure to understand firewall systems before opening
ports. For more information, see Security Considerations for a SQL Server
Installation.
After configuring the Database Engine to use a fixed port, follow the
following instructions to open that port in your Windows Firewall. (You do
not need to configure a fixed port for the default instance, because it is
already fixed on port 1433.)
To open a port in Windows Firewall
1. On the Start menu, click Control Panel.
2. In Control Panel, click Network and Internet Connections, and then
open Windows Firewall.
3. In Windows Firewall, click the Exceptions tab, and then click Add
Port.
4. In the Add a Port dialog box, in the Name box, type SQL Server
<instanceName>.
5. In the Port number box, type the port number of the Database Engine
instance. Use 1433 for the default instance. Type 1500 if you are
configuring a named instance and configured a fixed port in the previous
task. Verify that TCP is selected, and then click OK.
Connecting to the Database Engine from Another Computer
Now that you have configured the Database Engine to listen on a fixed port,
and have opened that port in the firewall, you can connect to SQL Server
from another computer.
When the SQL Server Browser service is running on the server computer, and
when the firewall has opened UDP port 1434, the connection can be made using
the computer name and instance name. To enhance security, our example does
not use the SQL Server Browser service.
To connect to the Database Engine from another computer
1. On a second computer containing the SQL Server 2005 client tools,
log in with an account authorized to connect to SQL Server, and open
Management Studio.
2. In the Connect to Server dialog box, confirm Database Engine in the
Server type box.
3. In the Server name box, type tcp: to specify the protocol, followed
by the computer name, a comma, and the port number. To connect to the
default instance, the port 1433 is implied and can be omitted, so type
tcp:<computer_name>. In our example for a named instance, type
tcp:<computer_name>,1500.
4. In the Authentication box, confirm Window Authentication, and then
click Connect.
Connecting Using the SQL Server Browser Service
The SQL Server Browser service listens for incoming requests for SQL Server
resources and provides information about SQL Server instances installed on
the computer. When the SQL Server Browser service is running, users can
connect to named instances by providing the computer name and instance name,
instead of the computer name and port number. Because SQL Server Browser
receives unauthenticated UDP requests, it is not always turned on during
setup. For a description of the service and an explanation of when it is
turned on, see SQL Server Browser Service.
To use the SQL Server Browser, you must follow the same steps as the
previous task in this lesson, and open UDP port 1434.
This concludes this brief tutorial on basic connectivity. For more
information about configuring server and client connectivity, see Database
Engine Connectivity How-to Topics.
Rick Byham
MCDBA, MCSE, MCSA
Lead Technical Writer,
Microsoft, SQL Server Books Online
This posting is provided "as is" with
no warranties, and confers no rights.
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:1ED4DC95-43E3-4647-92B7-2B11D1A2A28C@.microsoft.com...
>I have installed a SQL Server 2005 named instance with mixed authentication
> on a Windows 2003 Standard Server. SQL Server Service is running under
> local
> system account. I have not changed any default setting.
> I want to set up a System DSN in ODBC Data Source Administrator on a
> Windows
> XP SP2 machine to connect to the SQL Server 2005 named instance. But I
> get
> the message Specified SQL Server not found. I have no problem in setting
> up
> System DSN to connect to SQL Server 2000 named instances which is in
> another
> Windows 2003 Standard Server. I have not installed anything from SQL
> Server
> 2005 onto the Windows XP machine.
> Thanks for any help.
|||Hi Rick,
I have actually read this tutorial but I believe it is based on the scenario
that the client computer will have SQL Server 2005 component installed. I'm
trying to connect from a different computer which has no SQL Server 2005
component installed. If I understand correctly, SQL Native Client is
required if I'm trying to use new features in SQL Server 2005.
Environment:
Developer edition of SQL Server 2005 is installed on a Windows 2003 Standard
Edition with SP1 machine which has no Windows Firewall/ICS service running.
I have enabled the TCP/IP protocol through SQL Server Surface Area
Configuration. I'm trying to connect from a Windows XP Professional with SP2
machine which has the following exceptions in the Windows Firewall:
File and Printer Sharing
Remote Assistance
MSN Messenger 7.5
Remote Desktop
Please note that I have NOT installed anything from SQL Server 2005 CD onto
the Windows XP SP2 machine. I'm trying the connection in the ODBC
Administrator using SQL Server driver 2000.85.1117.00.
Thanks,
Peter
"Rick Byham [MS]" wrote:
> You didn't mention if the connection attempt was from the same computer. If
> you are connecting from a different computer, you probably need to use the
> Surface Area Configuration tool, and open the port in the Windows XP
> firewall. This tutorial may help you.
> Getting Started with the Database Engine
> Welcome to the Getting Started with the Database Engine tutorial. This
> tutorial is intended for users who are new to SQL Server 2005 and who have
> installed Developer, Express, or Evaluation Edition on a computer running
> Windows XP Professional Service Pack 1 (SP1).This brief tutorial helps you
> get started using the Database Engine.
> What You Will Learn
> This tutorial shows you how to connect to the Database Engine using SQL
> Server Management Studio or Management Studio Express, on both the local
> computer and from another computer.
> This tutorial is divided into two lessons:
> Lesson 1: Connecting to the Database Engine
> In this lesson, you will learn how to connect to the Database Engine and
> enable additional people to connect.
> Lesson 2: Connecting from Another Computer
> In this lesson, you will learn how to connect to the Database Engine from a
> second computer, including enabling protocols, configuring ports, and
> configuring firewall settings.
> Requirements
> This lesson has no knowledge prerequisites.
> Your system must have the following installed to use this tutorial:
> a.. Internet Explorer 6.0 or later.
> b.. Either SQL Server Management Studio or Management Studio Express.
> Lesson 1: Connecting to the Database Engine
> When you install the SQL Server 2005 Database Engine, the tools that are
> installed depend upon the edition and your setup choices. This lesson
> reviews the principal tools, and shows you how to connect and perform a
> basic function (authorizing more users).
> This lesson contains the following topics:
> a.. Tools for Getting Started
> b.. Connecting with Management Studio
> c.. Authorizing Additional Connections
> Tools for Getting Started
> The SQL Server 2005 Database Engine ships with a variety of tools. This
> topic describes the first tools you will need, and helps you select the
> right tool for the job. All tools can be accessed from the Start menu.
> Generally, tools such as SQL Server Management Studio are not installed by
> default. You must select the tools as part of the client components during
> setup. For complete description of the tools described below, search for
> them in Books Online. SQL Server 2005 Express Edition contains only a subset
> of the tools.
> Basic Tools
> a.. SQL Server Management Studio is the principal tool for administering
> the Database Engine and writing Transact-SQL code. It is hosted in the
> Visual Studio shell. It is not included in SQL Server 2005 Express Edition
> or SQL Server 2005 Mobile Edition.
> b.. SQL Server Management Studio Express is a free, limited version of SQL
> Server Management Studio, intended for use with SQL Server 2005 Express
> Edition and for users who want the basic features of Management Studio in a
> lightweight tool.
> c.. SQL Server Surface Area Configuration installs with SQL Server and
> lets you enable the server protocols, configure services to start
> automatically, and enable some optional features of the Database Engine.
> d.. SQL Server Configuration Manager installs with both SQL Server and the
> client tools. It lets you enable server protocols, configure protocol
> options such as TCP ports, configure server services to start automatically,
> and configure client computers to connect in your preferred manner.
> Sample Database
> SQL Server 2005 includes a sample database called AdventureWorks. This
> database is not installed by default. If you wish to experiment with the
> AdventureWorks database, you must select it using the Setup program. Most
> examples described in Books Online use the AdventureWorks database. For more
> information, see Running Setup to Install AdventureWorks Sample Databases
> and Samples.
> To start SQL Server Management Studio
> 1. On the Start menu, point to All Programs, point to Microsoft SQL
> Server 2005, and then click SQL Server Management Studio.
> To start SQL Server Surface Area Configuration or SQL Server Configuration
> Manager
> 1. On the Start menu, point to All Programs, point to Microsoft SQL
> Server 2005, point to Configuration Tools, and then click either SQL Server
> Surface Area Configuration or SQL Server Configuration Manager.
> Connecting with Management Studio
> It is easy to connect to the Database Engine from tools running on the same
> computer if you know the name of the instance, and if you are connecting as
> a member of the Administrators group on the computer. The following
> procedures must be performed on the same computer that hosts SQL Server.
> To determine the name of the Database Engine instance
> 1. Log into Windows as a member of the Administrators group, and open
> either Management Studio or Management Studio Express Edition.
> The Connect to Server dialog box opens.
> 2. Click Cancel.
> 3. If Registered Servers is not displayed, on the View menu, click
> Registered Servers.
> 4. With Database Engine selected on the Registered Servers toolbar,
> right-click Database Engine, and then click Update Local Server
> Registration. All instances of the Database Engine installed on the computer
> are displayed. This includes instances of SQL Server 2000. Management Studio
> can connect and manage instances of SQL Server 2000 as well as SQL Server
> 2005. The default instance is unnamed and is shown as the computer name. A
> named instance displays as the computer name followed by a backward slash
> (\) and then the name of the instance. For SQL Server 2005 Express Edition,
> the instance is named <computer_name>\sqlexpress unless the name was changed
> during setup.
> To verify that the Database Engine is running
> 1. In Registered Servers, if the name of your instance of SQL Server
> has a green dot with a white arrow next to the name, the Database Engine is
> running and no further action is necessary.
> 2. If the name of your instance of SQL Server has a red dot with a
> white square next to the name, the Database Engine is stopped. Right-click
> the name of the Database Engine, and then click Start. After a confirmation
> dialog box, the Database Engine should start and the circle should turn
> green.
> To connect to the Database Engine
> 1. On the File menu, click Connect Object Explorer.
> The Connect to Server dialog box opens. The Server type box displays the
> type that was last used.
> 2. Select Database Engine.
> 3. In the Server name box, type the name of the Database Engine
> instance.
> 4. Click Connect.
> Authorizing Additional Connections
> Now that you have connected to SQL Server as an administrator, one of your
> first tasks is to authorize other users to connect. You do this by creating
> a login and authorizing that login to access a database as a user. Logins
> can be either Windows Authentication logins, which use your Windows
> credentials, or SQL Server Authentication logins, which store the
> authentication information in SQL Server and are independent of your network
> credentials. Use Windows Authentication whenever possible.
> Create a Windows Authentication login
> 1. In the previous task, you connected to the Database Engine using
> Management Studio. In Object Explorer, expand your server instance, expand
> Security, right-click Logins, and then click New Login.
> The Login - New dialog box appears.
> 2. On the General page, in the Login name box, type a Windows login in
> the format <domain>\<login>.
> 3. In the Default database box, select AdventureWorks if available.
> Otherwise select master.
> 4. On the Server Roles page, if the new login is to be an
> administrator, click sysadmin, otherwise leave this blank.
> 5. On the User Mapping page, select Map for the AdventureWorks
> database if it is available. Otherwise select master. Note that the User box
> is populated with the login. When closed, the dialog box will create this
> user in the database.
> 6. In the Default Schema box, type dbo to map the login to the
> database administrator schema.
> 7. Accept the default settings for the Securables and Status boxes and
> click OK to create the login.
> Note:
> This is basic information to get you started. SQL Server provides a
> rich security environment, and security is obviously an important aspect of
> database operations. For more information about security, read the security
> sections of Books Online, starting with Security Considerations for
> Databases and Database Applications.
>
> Lesson 2: Connecting from Another Computer
> To enhance security, the Database Engine of SQL Server 2005 Developer,
> Express, and Evaluation Editions cannot be accessed from another computer
> when initially installed. This lesson shows you how to enable the protocols,
> configure the ports, and configure the Windows Firewall for connecting from
> other computers.
> This lesson contains the following topics:
> a.. Enabling Protocols
> b.. Configuring a Fixed Port
> c.. Opening Ports in the Firewall
> d.. Connecting to the Database Engine from Another Computer
> e.. Connecting Using the SQL Server Browser Service
> Enabling Protocols
> To enhance security, SQL Server 2005 Express Edition Developer Edition and
> Evaluation Edition install with only limited network connectivity.
> Connections to the Database Engine can be made from tools running the same
> computer, but not from other computers. If you are planning to do your
> development work on the same computer as the Database Engine, you're done.
> Management Studio or Management Studio Express Edition will connect to the
> Database Engine using the shared memory protocol, which is already enabled.
> If you plan to connect to the Database Engine from another computer, you
> must enable a protocol, such as TCP/IP.
> How to enable TCP/IP connections from another computer
> 1. Start SQL Server Surface Area Configuration, and click Surface Area
> Configuration for Services.
> 2. In the Surface Area Configuration for Services and Connections box,
> the View by Instance box lists the instances of the Database Engine
> installed on the computer. The default instance (an unnamed instance) is
> listed as MSSQLSERVER. If you installed a named instance, the name you
> provided is listed. SQL Server 2005 Express Edition installs as SQLEXPRESS
> unless you changed the name during setup. In the View by Instance box,
> expand the instance you wish to configure, expand Database Engine, and then
> click Remote Connections.
> 3. Click Local and remote connections, click Using TCP/IP only, then
> click OK and close the tool.
> Configuring a Fixed Port
> To enhance security, Windows XP Professional Service Pack 2 (SP2) turns on
> the Windows Firewall. When SQL Server 2005 Developer, Express, or Evaluation
> Edition is running on Windows XP Professional, and you wish to connect to it
> from another computer, you must open a communication port in the firewall.
> The default instance of the Database Engine listens on port 1433, so you do
> not need to configure a fixed port, but named instances including SQL Server
> 2005 Express Edition listen on dynamic ports. Before you can open a port in
> the firewall, you must first configure the Database Engine to listen on a
> specific port; otherwise the Database Engine may listen on a different port
> each time it is started.
> Configure SQL Server to listen on a specific port
> 1. In SQL Server Configuration Manager, expand SQL Server 2005 Network
> Configuration, and then click on the server instance you wish to configure.
> 2. In the right pane, double-click TCP/IP.
> 3. In the TCP/IP Properties dialog box, click the IP Addresses tab.
> 4. In the TCP Port box of the IPAll section, type an available port
> number. For this tutorial, we will use 1500.
> 5. Click OK to close the dialog box, and click OK to the warning that
> the service must be restarted.
> 6. In the left pane, click SQL Server 2005 Services.
> 7. In the right pane, right-click the instance of SQL Server, and then
> click Restart. When the Database Engine restarts, it will listen on port
> 1500.
> Opening Ports in the Firewall
> Firewall systems prevent unauthorized access to computer resources. To
> enhance security, Windows XP Professional Service Pack 2 (SP2) turns on
> Windows Firewall. To connect to SQL Server from another computer, you must
> open a port in the firewall.
> Important:
> Opening ports in your firewall can leave your server exposed to
> malicious attacks. Be sure to understand firewall systems before opening
> ports. For more information, see Security Considerations for a SQL Server
> Installation.
>
> After configuring the Database Engine to use a fixed port, follow the
> following instructions to open that port in your Windows Firewall. (You do
> not need to configure a fixed port for the default instance, because it is
> already fixed on port 1433.)
> To open a port in Windows Firewall
> 1. On the Start menu, click Control Panel.
> 2. In Control Panel, click Network and Internet Connections, and then
> open Windows Firewall.
> 3. In Windows Firewall, click the Exceptions tab, and then click Add
> Port.
> 4. In the Add a Port dialog box, in the Name box, type SQL Server
> <instanceName>.
> 5. In the Port number box, type the port number of the Database Engine
> instance. Use 1433 for the default instance. Type 1500 if you are
> configuring a named instance and configured a fixed port in the previous
> task. Verify that TCP is selected, and then click OK.
> Connecting to the Database Engine from Another Computer
> Now that you have configured the Database Engine to listen on a fixed port,
|||I have done this same thing and without incident. SQL 2000 client will
connect SQL 2005.
I don't know how to fix your problem but I know it can be fixed.
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:3EC1A2E1-85C8-4525-B25D-6A29287996A2@.microsoft.com...[vbcol=seagreen]
> Hi Rick,
> I have actually read this tutorial but I believe it is based on the
> scenario
> that the client computer will have SQL Server 2005 component installed.
> I'm
> trying to connect from a different computer which has no SQL Server 2005
> component installed. If I understand correctly, SQL Native Client is
> required if I'm trying to use new features in SQL Server 2005.
> Environment:
> Developer edition of SQL Server 2005 is installed on a Windows 2003
> Standard
> Edition with SP1 machine which has no Windows Firewall/ICS service
> running.
> I have enabled the TCP/IP protocol through SQL Server Surface Area
> Configuration. I'm trying to connect from a Windows XP Professional with
> SP2
> machine which has the following exceptions in the Windows Firewall:
> File and Printer Sharing
> Remote Assistance
> MSN Messenger 7.5
> Remote Desktop
> Please note that I have NOT installed anything from SQL Server 2005 CD
> onto
> the Windows XP SP2 machine. I'm trying the connection in the ODBC
> Administrator using SQL Server driver 2000.85.1117.00.
>
> Thanks,
> Peter
> "Rick Byham [MS]" wrote:
How to connect a workstation to SQL Server 2005 thru ODBC?
on a Windows 2003 Standard Server. SQL Server Service is running under loca
l
system account. I have not changed any default setting.
I want to set up a System DSN in ODBC Data Source Administrator on a Windows
XP SP2 machine to connect to the SQL Server 2005 named instance. But I get
the message Specified SQL Server not found. I have no problem in setting u
p
System DSN to connect to SQL Server 2000 named instances which is in another
Windows 2003 Standard Server. I have not installed anything from SQL Serve
r
2005 onto the Windows XP machine.
Thanks for any help.You didn't mention if the connection attempt was from the same computer. If
you are connecting from a different computer, you probably need to use the
Surface Area Configuration tool, and open the port in the Windows XP
firewall. This tutorial may help you.
Getting Started with the Database Engine
Welcome to the Getting Started with the Database Engine tutorial. This
tutorial is intended for users who are new to SQL Server 2005 and who have
installed Developer, Express, or Evaluation Edition on a computer running
Windows XP Professional Service Pack 1 (SP1).This brief tutorial helps you
get started using the Database Engine.
What You Will Learn
This tutorial shows you how to connect to the Database Engine using SQL
Server Management Studio or Management Studio Express, on both the local
computer and from another computer.
This tutorial is divided into two lessons:
Lesson 1: Connecting to the Database Engine
In this lesson, you will learn how to connect to the Database Engine and
enable additional people to connect.
Lesson 2: Connecting from Another Computer
In this lesson, you will learn how to connect to the Database Engine from a
second computer, including enabling protocols, configuring ports, and
configuring firewall settings.
Requirements
This lesson has no knowledge prerequisites.
Your system must have the following installed to use this tutorial:
a.. Internet Explorer 6.0 or later.
b.. Either SQL Server Management Studio or Management Studio Express.
Lesson 1: Connecting to the Database Engine
When you install the SQL Server 2005 Database Engine, the tools that are
installed depend upon the edition and your setup choices. This lesson
reviews the principal tools, and shows you how to connect and perform a
basic function (authorizing more users).
This lesson contains the following topics:
a.. Tools for Getting Started
b.. Connecting with Management Studio
c.. Authorizing Additional Connections
Tools for Getting Started
The SQL Server 2005 Database Engine ships with a variety of tools. This
topic describes the first tools you will need, and helps you select the
right tool for the job. All tools can be accessed from the Start menu.
Generally, tools such as SQL Server Management Studio are not installed by
default. You must select the tools as part of the client components during
setup. For complete description of the tools described below, search for
them in Books Online. SQL Server 2005 Express Edition contains only a subset
of the tools.
Basic Tools
a.. SQL Server Management Studio is the principal tool for administering
the Database Engine and writing Transact-SQL code. It is hosted in the
Visual Studio shell. It is not included in SQL Server 2005 Express Edition
or SQL Server 2005 Mobile Edition.
b.. SQL Server Management Studio Express is a free, limited version of SQL
Server Management Studio, intended for use with SQL Server 2005 Express
Edition and for users who want the basic features of Management Studio in a
lightweight tool.
c.. SQL Server Surface Area Configuration installs with SQL Server and
lets you enable the server protocols, configure services to start
automatically, and enable some optional features of the Database Engine.
d.. SQL Server Configuration Manager installs with both SQL Server and the
client tools. It lets you enable server protocols, configure protocol
options such as TCP ports, configure server services to start automatically,
and configure client computers to connect in your preferred manner.
Sample Database
SQL Server 2005 includes a sample database called AdventureWorks. This
database is not installed by default. If you wish to experiment with the
AdventureWorks database, you must select it using the Setup program. Most
examples described in Books Online use the AdventureWorks database. For more
information, see Running Setup to Install AdventureWorks Sample Databases
and Samples.
To start SQL Server Management Studio
1. On the Start menu, point to All Programs, point to Microsoft SQL
Server 2005, and then click SQL Server Management Studio.
To start SQL Server Surface Area Configuration or SQL Server Configuration
Manager
1. On the Start menu, point to All Programs, point to Microsoft SQL
Server 2005, point to Configuration Tools, and then click either SQL Server
Surface Area Configuration or SQL Server Configuration Manager.
Connecting with Management Studio
It is easy to connect to the Database Engine from tools running on the same
computer if you know the name of the instance, and if you are connecting as
a member of the Administrators group on the computer. The following
procedures must be performed on the same computer that hosts SQL Server.
To determine the name of the Database Engine instance
1. Log into Windows as a member of the Administrators group, and open
either Management Studio or Management Studio Express Edition.
The Connect to Server dialog box opens.
2. Click Cancel.
3. If Registered Servers is not displayed, on the View menu, click
Registered Servers.
4. With Database Engine selected on the Registered Servers toolbar,
right-click Database Engine, and then click Update Local Server
Registration. All instances of the Database Engine installed on the computer
are displayed. This includes instances of SQL Server 2000. Management Studio
can connect and manage instances of SQL Server 2000 as well as SQL Server
2005. The default instance is unnamed and is shown as the computer name. A
named instance displays as the computer name followed by a backward slash
(\) and then the name of the instance. For SQL Server 2005 Express Edition,
the instance is named <computer_name>\sqlexpress unless the name was changed
during setup.
To verify that the Database Engine is running
1. In Registered Servers, if the name of your instance of SQL Server
has a green dot with a white arrow next to the name, the Database Engine is
running and no further action is necessary.
2. If the name of your instance of SQL Server has a red dot with a
white square next to the name, the Database Engine is stopped. Right-click
the name of the Database Engine, and then click Start. After a confirmation
dialog box, the Database Engine should start and the circle should turn
green.
To connect to the Database Engine
1. On the File menu, click Connect Object Explorer.
The Connect to Server dialog box opens. The Server type box displays the
type that was last used.
2. Select Database Engine.
3. In the Server name box, type the name of the Database Engine
instance.
4. Click Connect.
Authorizing Additional Connections
Now that you have connected to SQL Server as an administrator, one of your
first tasks is to authorize other users to connect. You do this by creating
a login and authorizing that login to access a database as a user. Logins
can be either Windows Authentication logins, which use your Windows
credentials, or SQL Server Authentication logins, which store the
authentication information in SQL Server and are independent of your network
credentials. Use Windows Authentication whenever possible.
Create a Windows Authentication login
1. In the previous task, you connected to the Database Engine using
Management Studio. In Object Explorer, expand your server instance, expand
Security, right-click Logins, and then click New Login.
The Login - New dialog box appears.
2. On the General page, in the Login name box, type a Windows login in
the format <domain>\<login>.
3. In the Default database box, select AdventureWorks if available.
Otherwise select master.
4. On the Server Roles page, if the new login is to be an
administrator, click sysadmin, otherwise leave this blank.
5. On the User Mapping page, select Map for the AdventureWorks
database if it is available. Otherwise select master. Note that the User box
is populated with the login. When closed, the dialog box will create this
user in the database.
6. In the Default Schema box, type dbo to map the login to the
database administrator schema.
7. Accept the default settings for the Securables and Status boxes and
click OK to create the login.
Note:
This is basic information to get you started. SQL Server provides a
rich security environment, and security is obviously an important aspect of
database operations. For more information about security, read the security
sections of Books Online, starting with Security Considerations for
Databases and Database Applications.
Lesson 2: Connecting from Another Computer
To enhance security, the Database Engine of SQL Server 2005 Developer,
Express, and Evaluation Editions cannot be accessed from another computer
when initially installed. This lesson shows you how to enable the protocols,
configure the ports, and configure the Windows Firewall for connecting from
other computers.
This lesson contains the following topics:
a.. Enabling Protocols
b.. Configuring a Fixed Port
c.. Opening Ports in the Firewall
d.. Connecting to the Database Engine from Another Computer
e.. Connecting Using the SQL Server Browser Service
Enabling Protocols
To enhance security, SQL Server 2005 Express Edition Developer Edition and
Evaluation Edition install with only limited network connectivity.
Connections to the Database Engine can be made from tools running the same
computer, but not from other computers. If you are planning to do your
development work on the same computer as the Database Engine, you're done.
Management Studio or Management Studio Express Edition will connect to the
Database Engine using the shared memory protocol, which is already enabled.
If you plan to connect to the Database Engine from another computer, you
must enable a protocol, such as TCP/IP.
How to enable TCP/IP connections from another computer
1. Start SQL Server Surface Area Configuration, and click Surface Area
Configuration for Services.
2. In the Surface Area Configuration for Services and Connections box,
the View by Instance box lists the instances of the Database Engine
installed on the computer. The default instance (an unnamed instance) is
listed as MSSQLSERVER. If you installed a named instance, the name you
provided is listed. SQL Server 2005 Express Edition installs as SQLEXPRESS
unless you changed the name during setup. In the View by Instance box,
expand the instance you wish to configure, expand Database Engine, and then
click Remote Connections.
3. Click Local and remote connections, click Using TCP/IP only, then
click OK and close the tool.
Configuring a Fixed Port
To enhance security, Windows XP Professional Service Pack 2 (SP2) turns on
the Windows Firewall. When SQL Server 2005 Developer, Express, or Evaluation
Edition is running on Windows XP Professional, and you wish to connect to it
from another computer, you must open a communication port in the firewall.
The default instance of the Database Engine listens on port 1433, so you do
not need to configure a fixed port, but named instances including SQL Server
2005 Express Edition listen on dynamic ports. Before you can open a port in
the firewall, you must first configure the Database Engine to listen on a
specific port; otherwise the Database Engine may listen on a different port
each time it is started.
Configure SQL Server to listen on a specific port
1. In SQL Server Configuration Manager, expand SQL Server 2005 Network
Configuration, and then click on the server instance you wish to configure.
2. In the right pane, double-click TCP/IP.
3. In the TCP/IP Properties dialog box, click the IP Addresses tab.
4. In the TCP Port box of the IPAll section, type an available port
number. For this tutorial, we will use 1500.
5. Click OK to close the dialog box, and click OK to the warning that
the service must be restarted.
6. In the left pane, click SQL Server 2005 Services.
7. In the right pane, right-click the instance of SQL Server, and then
click Restart. When the Database Engine restarts, it will listen on port
1500.
Opening Ports in the Firewall
Firewall systems prevent unauthorized access to computer resources. To
enhance security, Windows XP Professional Service Pack 2 (SP2) turns on
Windows Firewall. To connect to SQL Server from another computer, you must
open a port in the firewall.
Important:
Opening ports in your firewall can leave your server exposed to
malicious attacks. Be sure to understand firewall systems before opening
ports. For more information, see Security Considerations for a SQL Server
Installation.
After configuring the Database Engine to use a fixed port, follow the
following instructions to open that port in your Windows Firewall. (You do
not need to configure a fixed port for the default instance, because it is
already fixed on port 1433.)
To open a port in Windows Firewall
1. On the Start menu, click Control Panel.
2. In Control Panel, click Network and Internet Connections, and then
open Windows Firewall.
3. In Windows Firewall, click the Exceptions tab, and then click Add
Port.
4. In the Add a Port dialog box, in the Name box, type SQL Server
<instanceName>.
5. In the Port number box, type the port number of the Database Engine
instance. Use 1433 for the default instance. Type 1500 if you are
configuring a named instance and configured a fixed port in the previous
task. Verify that TCP is selected, and then click OK.
Connecting to the Database Engine from Another Computer
Now that you have configured the Database Engine to listen on a fixed port,
and have opened that port in the firewall, you can connect to SQL Server
from another computer.
When the SQL Server Browser service is running on the server computer, and
when the firewall has opened UDP port 1434, the connection can be made using
the computer name and instance name. To enhance security, our example does
not use the SQL Server Browser service.
To connect to the Database Engine from another computer
1. On a second computer containing the SQL Server 2005 client tools,
log in with an account authorized to connect to SQL Server, and open
Management Studio.
2. In the Connect to Server dialog box, confirm Database Engine in the
Server type box.
3. In the Server name box, type tcp: to specify the protocol, followed
by the computer name, a comma, and the port number. To connect to the
default instance, the port 1433 is implied and can be omitted, so type
tcp:<computer_name>. In our example for a named instance, type
tcp:<computer_name>,1500.
4. In the Authentication box, confirm Window Authentication, and then
click Connect.
Connecting Using the SQL Server Browser Service
The SQL Server Browser service listens for incoming requests for SQL Server
resources and provides information about SQL Server instances installed on
the computer. When the SQL Server Browser service is running, users can
connect to named instances by providing the computer name and instance name,
instead of the computer name and port number. Because SQL Server Browser
receives unauthenticated UDP requests, it is not always turned on during
setup. For a description of the service and an explanation of when it is
turned on, see SQL Server Browser Service.
To use the SQL Server Browser, you must follow the same steps as the
previous task in this lesson, and open UDP port 1434.
This concludes this brief tutorial on basic connectivity. For more
information about configuring server and client connectivity, see Database
Engine Connectivity How-to Topics.
Rick Byham
MCDBA, MCSE, MCSA
Lead Technical Writer,
Microsoft, SQL Server Books Online
This posting is provided "as is" with
no warranties, and confers no rights.
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:1ED4DC95-43E3-4647-92B7-2B11D1A2A28C@.microsoft.com...
>I have installed a SQL Server 2005 named instance with mixed authentication
> on a Windows 2003 Standard Server. SQL Server Service is running under
> local
> system account. I have not changed any default setting.
> I want to set up a System DSN in ODBC Data Source Administrator on a
> Windows
> XP SP2 machine to connect to the SQL Server 2005 named instance. But I
> get
> the message Specified SQL Server not found. I have no problem in setting
> up
> System DSN to connect to SQL Server 2000 named instances which is in
> another
> Windows 2003 Standard Server. I have not installed anything from SQL
> Server
> 2005 onto the Windows XP machine.
> Thanks for any help.|||Hi Rick,
I have actually read this tutorial but I believe it is based on the scenario
that the client computer will have SQL Server 2005 component installed. I'
m
trying to connect from a different computer which has no SQL Server 2005
component installed. If I understand correctly, SQL Native Client is
required if I'm trying to use new features in SQL Server 2005.
Environment:
Developer edition of SQL Server 2005 is installed on a Windows 2003 Standard
Edition with SP1 machine which has no Windows Firewall/ICS service running.
I have enabled the TCP/IP protocol through SQL Server Surface Area
Configuration. I'm trying to connect from a Windows XP Professional with SP2
machine which has the following exceptions in the Windows Firewall:
File and Printer Sharing
Remote Assistance
MSN Messenger 7.5
Remote Desktop
Please note that I have NOT installed anything from SQL Server 2005 CD onto
the Windows XP SP2 machine. I'm trying the connection in the ODBC
Administrator using SQL Server driver 2000.85.1117.00.
Thanks,
Peter
"Rick Byham [MS]" wrote:
[vbcol=seagreen]
> You didn't mention if the connection attempt was from the same computer. I
f
> you are connecting from a different computer, you probably need to use the
> Surface Area Configuration tool, and open the port in the Windows XP
> firewall. This tutorial may help you.
> Getting Started with the Database Engine
> Welcome to the Getting Started with the Database Engine tutorial. This
> tutorial is intended for users who are new to SQL Server 2005 and who have
> installed Developer, Express, or Evaluation Edition on a computer running
> Windows XP Professional Service Pack 1 (SP1).This brief tutorial helps you
> get started using the Database Engine.
> What You Will Learn
> This tutorial shows you how to connect to the Database Engine using SQL
> Server Management Studio or Management Studio Express, on both the local
> computer and from another computer.
> This tutorial is divided into two lessons:
> Lesson 1: Connecting to the Database Engine
> In this lesson, you will learn how to connect to the Database Engine and
> enable additional people to connect.
> Lesson 2: Connecting from Another Computer
> In this lesson, you will learn how to connect to the Database Engine from
a
> second computer, including enabling protocols, configuring ports, and
> configuring firewall settings.
> Requirements
> This lesson has no knowledge prerequisites.
> Your system must have the following installed to use this tutorial:
> a.. Internet Explorer 6.0 or later.
> b.. Either SQL Server Management Studio or Management Studio Express.
> Lesson 1: Connecting to the Database Engine
> When you install the SQL Server 2005 Database Engine, the tools that are
> installed depend upon the edition and your setup choices. This lesson
> reviews the principal tools, and shows you how to connect and perform a
> basic function (authorizing more users).
> This lesson contains the following topics:
> a.. Tools for Getting Started
> b.. Connecting with Management Studio
> c.. Authorizing Additional Connections
> Tools for Getting Started
> The SQL Server 2005 Database Engine ships with a variety of tools. This
> topic describes the first tools you will need, and helps you select the
> right tool for the job. All tools can be accessed from the Start menu.
> Generally, tools such as SQL Server Management Studio are not installed by
> default. You must select the tools as part of the client components during
> setup. For complete description of the tools described below, search for
> them in Books Online. SQL Server 2005 Express Edition contains only a subs
et
> of the tools.
> Basic Tools
> a.. SQL Server Management Studio is the principal tool for administering
> the Database Engine and writing Transact-SQL code. It is hosted in the
> Visual Studio shell. It is not included in SQL Server 2005 Express Edition
> or SQL Server 2005 Mobile Edition.
> b.. SQL Server Management Studio Express is a free, limited version of S
QL
> Server Management Studio, intended for use with SQL Server 2005 Express
> Edition and for users who want the basic features of Management Studio in
a
> lightweight tool.
> c.. SQL Server Surface Area Configuration installs with SQL Server and
> lets you enable the server protocols, configure services to start
> automatically, and enable some optional features of the Database Engine.
> d.. SQL Server Configuration Manager installs with both SQL Server and t
he
> client tools. It lets you enable server protocols, configure protocol
> options such as TCP ports, configure server services to start automaticall
y,
> and configure client computers to connect in your preferred manner.
> Sample Database
> SQL Server 2005 includes a sample database called AdventureWorks. This
> database is not installed by default. If you wish to experiment with the
> AdventureWorks database, you must select it using the Setup program. Most
> examples described in Books Online use the AdventureWorks database. For mo
re
> information, see Running Setup to Install AdventureWorks Sample Databases
> and Samples.
> To start SQL Server Management Studio
> 1. On the Start menu, point to All Programs, point to Microsoft SQL
> Server 2005, and then click SQL Server Management Studio.
> To start SQL Server Surface Area Configuration or SQL Server Configuration
> Manager
> 1. On the Start menu, point to All Programs, point to Microsoft SQL
> Server 2005, point to Configuration Tools, and then click either SQL Serve
r
> Surface Area Configuration or SQL Server Configuration Manager.
> Connecting with Management Studio
> It is easy to connect to the Database Engine from tools running on the sam
e
> computer if you know the name of the instance, and if you are connecting a
s
> a member of the Administrators group on the computer. The following
> procedures must be performed on the same computer that hosts SQL Server.
> To determine the name of the Database Engine instance
> 1. Log into Windows as a member of the Administrators group, and ope
n
> either Management Studio or Management Studio Express Edition.
> The Connect to Server dialog box opens.
> 2. Click Cancel.
> 3. If Registered Servers is not displayed, on the View menu, click
> Registered Servers.
> 4. With Database Engine selected on the Registered Servers toolbar,
> right-click Database Engine, and then click Update Local Server
> Registration. All instances of the Database Engine installed on the comput
er
> are displayed. This includes instances of SQL Server 2000. Management Stud
io
> can connect and manage instances of SQL Server 2000 as well as SQL Server
> 2005. The default instance is unnamed and is shown as the computer name. A
> named instance displays as the computer name followed by a backward slash
> (\) and then the name of the instance. For SQL Server 2005 Express Edition
,
> the instance is named <computer_name>\sqlexpress unless the name was chang
ed
> during setup.
> To verify that the Database Engine is running
> 1. In Registered Servers, if the name of your instance of SQL Server
> has a green dot with a white arrow next to the name, the Database Engine i
s
> running and no further action is necessary.
> 2. If the name of your instance of SQL Server has a red dot with a
> white square next to the name, the Database Engine is stopped. Right-click
> the name of the Database Engine, and then click Start. After a confirmatio
n
> dialog box, the Database Engine should start and the circle should turn
> green.
> To connect to the Database Engine
> 1. On the File menu, click Connect Object Explorer.
> The Connect to Server dialog box opens. The Server type box displays the
> type that was last used.
> 2. Select Database Engine.
> 3. In the Server name box, type the name of the Database Engine
> instance.
> 4. Click Connect.
> Authorizing Additional Connections
> Now that you have connected to SQL Server as an administrator, one of your
> first tasks is to authorize other users to connect. You do this by creatin
g
> a login and authorizing that login to access a database as a user. Logins
> can be either Windows Authentication logins, which use your Windows
> credentials, or SQL Server Authentication logins, which store the
> authentication information in SQL Server and are independent of your netwo
rk
> credentials. Use Windows Authentication whenever possible.
> Create a Windows Authentication login
> 1. In the previous task, you connected to the Database Engine using
> Management Studio. In Object Explorer, expand your server instance, expand
> Security, right-click Logins, and then click New Login.
> The Login - New dialog box appears.
> 2. On the General page, in the Login name box, type a Windows login
in
> the format <domain>\<login>.
> 3. In the Default database box, select AdventureWorks if available.
> Otherwise select master.
> 4. On the Server Roles page, if the new login is to be an
> administrator, click sysadmin, otherwise leave this blank.
> 5. On the User Mapping page, select Map for the AdventureWorks
> database if it is available. Otherwise select master. Note that the User b
ox
> is populated with the login. When closed, the dialog box will create this
> user in the database.
> 6. In the Default Schema box, type dbo to map the login to the
> database administrator schema.
> 7. Accept the default settings for the Securables and Status boxes a
nd
> click OK to create the login.
> Note:
> This is basic information to get you started. SQL Server provides a
> rich security environment, and security is obviously an important aspect o
f
> database operations. For more information about security, read the securit
y
> sections of Books Online, starting with Security Considerations for
> Databases and Database Applications.
>
> Lesson 2: Connecting from Another Computer
> To enhance security, the Database Engine of SQL Server 2005 Developer,
> Express, and Evaluation Editions cannot be accessed from another computer
> when initially installed. This lesson shows you how to enable the protocol
s,
> configure the ports, and configure the Windows Firewall for connecting fro
m
> other computers.
> This lesson contains the following topics:
> a.. Enabling Protocols
> b.. Configuring a Fixed Port
> c.. Opening Ports in the Firewall
> d.. Connecting to the Database Engine from Another Computer
> e.. Connecting Using the SQL Server Browser Service
> Enabling Protocols
> To enhance security, SQL Server 2005 Express Edition Developer Edition and
> Evaluation Edition install with only limited network connectivity.
> Connections to the Database Engine can be made from tools running the same
> computer, but not from other computers. If you are planning to do your
> development work on the same computer as the Database Engine, you're done.
> Management Studio or Management Studio Express Edition will connect to the
> Database Engine using the shared memory protocol, which is already enabled
.
> If you plan to connect to the Database Engine from another computer, you
> must enable a protocol, such as TCP/IP.
> How to enable TCP/IP connections from another computer
> 1. Start SQL Server Surface Area Configuration, and click Surface Ar
ea
> Configuration for Services.
> 2. In the Surface Area Configuration for Services and Connections bo
x,
> the View by Instance box lists the instances of the Database Engine
> installed on the computer. The default instance (an unnamed instance) is
> listed as MSSQLSERVER. If you installed a named instance, the name you
> provided is listed. SQL Server 2005 Express Edition installs as SQLEXPRESS
> unless you changed the name during setup. In the View by Instance box,
> expand the instance you wish to configure, expand Database Engine, and the
n
> click Remote Connections.
> 3. Click Local and remote connections, click Using TCP/IP only, then
> click OK and close the tool.
> Configuring a Fixed Port
> To enhance security, Windows XP Professional Service Pack 2 (SP2) turns on
> the Windows Firewall. When SQL Server 2005 Developer, Express, or Evaluati
on
> Edition is running on Windows XP Professional, and you wish to connect to
it
> from another computer, you must open a communication port in the firewall.
> The default instance of the Database Engine listens on port 1433, so you d
o
> not need to configure a fixed port, but named instances including SQL Serv
er
> 2005 Express Edition listen on dynamic ports. Before you can open a port i
n
> the firewall, you must first configure the Database Engine to listen on a
> specific port; otherwise the Database Engine may listen on a different por
t
> each time it is started.
> Configure SQL Server to listen on a specific port
> 1. In SQL Server Configuration Manager, expand SQL Server 2005 Netwo
rk
> Configuration, and then click on the server instance you wish to configure
.
> 2. In the right pane, double-click TCP/IP.
> 3. In the TCP/IP Properties dialog box, click the IP Addresses tab.
> 4. In the TCP Port box of the IPAll section, type an available port
> number. For this tutorial, we will use 1500.
> 5. Click OK to close the dialog box, and click OK to the warning tha
t
> the service must be restarted.
> 6. In the left pane, click SQL Server 2005 Services.
> 7. In the right pane, right-click the instance of SQL Server, and th
en
> click Restart. When the Database Engine restarts, it will listen on port
> 1500.
> Opening Ports in the Firewall
> Firewall systems prevent unauthorized access to computer resources. To
> enhance security, Windows XP Professional Service Pack 2 (SP2) turns on
> Windows Firewall. To connect to SQL Server from another computer, you must
> open a port in the firewall.
> Important:
> Opening ports in your firewall can leave your server exposed to
> malicious attacks. Be sure to understand firewall systems before opening
> ports. For more information, see Security Considerations for a SQL Server
> Installation.
>
> After configuring the Database Engine to use a fixed port, follow the
> following instructions to open that port in your Windows Firewall. (You do
> not need to configure a fixed port for the default instance, because it is
> already fixed on port 1433.)
> To open a port in Windows Firewall
> 1. On the Start menu, click Control Panel.
> 2. In Control Panel, click Network and Internet Connections, and the
n
> open Windows Firewall.
> 3. In Windows Firewall, click the Exceptions tab, and then click Add
> Port.
> 4. In the Add a Port dialog box, in the Name box, type SQL Server
> <instanceName>.
> 5. In the Port number box, type the port number of the Database Engi
ne
> instance. Use 1433 for the default instance. Type 1500 if you are
> configuring a named instance and configured a fixed port in the previous
> task. Verify that TCP is selected, and then click OK.
> Connecting to the Database Engine from Another Computer
> Now that you have configured the Database Engine to listen on a fixed port,[/vbcol
]|||I have done this same thing and without incident. SQL 2000 client will
connect SQL 2005.
I don't know how to fix your problem but I know it can be fixed.
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:3EC1A2E1-85C8-4525-B25D-6A29287996A2@.microsoft.com...[vbcol=seagreen]
> Hi Rick,
> I have actually read this tutorial but I believe it is based on the
> scenario
> that the client computer will have SQL Server 2005 component installed.
> I'm
> trying to connect from a different computer which has no SQL Server 2005
> component installed. If I understand correctly, SQL Native Client is
> required if I'm trying to use new features in SQL Server 2005.
> Environment:
> Developer edition of SQL Server 2005 is installed on a Windows 2003
> Standard
> Edition with SP1 machine which has no Windows Firewall/ICS service
> running.
> I have enabled the TCP/IP protocol through SQL Server Surface Area
> Configuration. I'm trying to connect from a Windows XP Professional with
> SP2
> machine which has the following exceptions in the Windows Firewall:
> File and Printer Sharing
> Remote Assistance
> MSN Messenger 7.5
> Remote Desktop
> Please note that I have NOT installed anything from SQL Server 2005 CD
> onto
> the Windows XP SP2 machine. I'm trying the connection in the ODBC
> Administrator using SQL Server driver 2000.85.1117.00.
>
> Thanks,
> Peter
> "Rick Byham [MS]" wrote:
>