Showing posts with label stuff. Show all posts
Showing posts with label stuff. Show all posts

Sunday, February 12, 2012

can''t connect to local user instance

Just when I think I have this stuff figured out, it bites me back everytime.

I'm

trying to deploy an mdf out to a different machine, and attached to it with local user instance. I connect without problem from my development

machine with a local user instance, which also has Express Manager resident,

and I can connect to a server instance without problem.

What I can't do is

copy the .mdf database over to another workstation, which has Sql Native

Client installed, and connect to the database using a local user

instance! I can connect to a server instance without problem from this

other workstation. Here's my connect string for local user instance

that works fine from my dev machine:

Provider=SQLNCLI.1;Persist

Security Info=False;Integrated Security=SSPI;Data

Source=.\sqlexpress;AttachDBFileName=<full path_name and mdf

filename>;User Instance=true;

The error I get upon trying to connect with other stations is:

Error -2147467259
Database not found or cound not connect to database

I've

tried this every way I know how. I've copied the database from my dev

machine both with and without having detached the database from the

local instance. I've tried detaching from a server instance and copying

the file over. Nothing works, and I've done this before! What gives with this thing?

Rick

Hi,

is SQL Server Service allowed to access the datafiles ?

Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||Jens ... How can tell this? What service should I examine? I don't see any reference to the Sql Native client, other than I know it's installed.

I thought this process consisted of:

- install the Sql Native Client on target machine
- put a local copy of the database on target machine
- connect to the mdf with a local user instance

As I said, I can connect to remote server database from the machine. The folder names differ from my development machine to the target machine, but that shouldn't make difference, should it? I will say that in Sql Express Manager on my dev machine (which works), the full path and database name (i.e..c:\_source\project\mydata.mdf) shows in the database tree.

Rick|||

Hi Rick,

SQL Express does not allow attaching database from a UNC or mapped drive. It wasn't totally clear, but it reads like that what you're trying to do. Also, you can not connect to a User Instance on a different machine as User Instances only support local named pipes connections.

Mike

|||Nevermind. I'm apparently having a mental episode and forgot the one vital requirement of installing SqlExpress on the target instead of just the Sql Native Client. Hadn't had to do this in a while since I've been hitting a server for Sql Express databases. Sorry!

Rick

can't connect to local user instance

Just when I think I have this stuff figured out, it bites me back everytime.

I'm

trying to deploy an mdf out to a different machine, and attached to it with local user instance. I connect without problem from my development

machine with a local user instance, which also has Express Manager resident,

and I can connect to a server instance without problem.

What I can't do is

copy the .mdf database over to another workstation, which has Sql Native

Client installed, and connect to the database using a local user

instance! I can connect to a server instance without problem from this

other workstation. Here's my connect string for local user instance

that works fine from my dev machine:

Provider=SQLNCLI.1;Persist

Security Info=False;Integrated Security=SSPI;Data

Source=.\sqlexpress;AttachDBFileName=<full path_name and mdf

filename>;User Instance=true;

The error I get upon trying to connect with other stations is:

Error -2147467259
Database not found or cound not connect to database

I've

tried this every way I know how. I've copied the database from my dev

machine both with and without having detached the database from the

local instance. I've tried detaching from a server instance and copying

the file over. Nothing works, and I've done this before! What gives with this thing?

Rick

Hi,

is SQL Server Service allowed to access the datafiles ?

Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||Jens ... How can tell this? What service should I examine? I don't see any reference to the Sql Native client, other than I know it's installed.

I thought this process consisted of:

- install the Sql Native Client on target machine
- put a local copy of the database on target machine
- connect to the mdf with a local user instance

As I said, I can connect to remote server database from the machine. The folder names differ from my development machine to the target machine, but that shouldn't make difference, should it? I will say that in Sql Express Manager on my dev machine (which works), the full path and database name (i.e..c:\_source\project\mydata.mdf) shows in the database tree.

Rick|||

Hi Rick,

SQL Express does not allow attaching database from a UNC or mapped drive. It wasn't totally clear, but it reads like that what you're trying to do. Also, you can not connect to a User Instance on a different machine as User Instances only support local named pipes connections.

Mike

|||Nevermind. I'm apparently having a mental episode and forgot the one vital requirement of installing SqlExpress on the target instead of just the Sql Native Client. Hadn't had to do this in a while since I've been hitting a server for Sql Express databases. Sorry!

Rick

Can't connect to databases through Enterprise Manager

Understand I am not a DBA. I am just the guy who has to
work with this stuff.
We have client software that uses SQL 7 as a database.
Winpak is a door access software made by Northern. It
stores proxy card info, access levels, historys, etc. in
a SQL 7 database. I know the databases are still there
because Winpak connects and I can pull up info.
This started because I noticed whoever set up the primary
and archive databases pointed them both to the same file
name. I backed up the primary and deleted it. Restored
it with the full backup and made sure it was pointed to a
different file name. Everything worked fine and still
showed up in Enterprise Manager. I restarted the computer
later and tried to go back into Enterprise Manager. Tried
to expand 'SQL Server Group' to list all the databases and
I got an error saying, "A connection could not be
established to COMPUTER - Cannot open user default
database '<ID>'. Using master database instead. Please
verify SQL Server is running and check your SQL Server
registration properties (by right-clicking on the COMPUTER
node) and try again."
My services were running just fine and when I checked my
registration properties everything looked fine. Redid the
registration properties with no luck. Using NT
authentication and even making a new one. The other
problem is that somebody set this thing up 3 years ago and
I have no idea what the 'sa' password is and I have tried
every simple password I can think of. I am checked out
the knowledge database articles matching my error message
and they didn't realy help cuz I either needed the 'sa'
password or I don't know how to impliment the solution
based on my limited knowledge of SQL. I need to do a
final backup to move all the info to a new machine with
SQL 2000. I am really stuck (and screwed) if I can't get
that info off cuz we just entered in a few hundred more
employees so using an old backup isn't going to save me.
Help would be greatly appreciated
Hi,
It seems the Login ID you are using is defaulted to the database you have
deleted. That is the reason you are getting the error.
How to change the SA Password,
1. Login to Query analyzer using Windows Authentication
2. Execute the beloe command
sp_password null,'passwordsa',sa
(now the password for sa is passwordsa)
How to change the default database of your existing users, which gave error
1. Login to query analyzer as SA
2. execute below statement
sp_defaultdb <loginame>,<new database name>
3. After this you will be able to login using the old id itself.
Thanks
Hari
MCDBA
"Brendan" <anonymous@.discussions.microsoft.com> wrote in message
news:124bf01c41152$811230e0$a501280a@.phx.gbl...
> Understand I am not a DBA. I am just the guy who has to
> work with this stuff.
> We have client software that uses SQL 7 as a database.
> Winpak is a door access software made by Northern. It
> stores proxy card info, access levels, historys, etc. in
> a SQL 7 database. I know the databases are still there
> because Winpak connects and I can pull up info.
> This started because I noticed whoever set up the primary
> and archive databases pointed them both to the same file
> name. I backed up the primary and deleted it. Restored
> it with the full backup and made sure it was pointed to a
> different file name. Everything worked fine and still
> showed up in Enterprise Manager. I restarted the computer
> later and tried to go back into Enterprise Manager. Tried
> to expand 'SQL Server Group' to list all the databases and
> I got an error saying, "A connection could not be
> established to COMPUTER - Cannot open user default
> database '<ID>'. Using master database instead. Please
> verify SQL Server is running and check your SQL Server
> registration properties (by right-clicking on the COMPUTER
> node) and try again."
> My services were running just fine and when I checked my
> registration properties everything looked fine. Redid the
> registration properties with no luck. Using NT
> authentication and even making a new one. The other
> problem is that somebody set this thing up 3 years ago and
> I have no idea what the 'sa' password is and I have tried
> every simple password I can think of. I am checked out
> the knowledge database articles matching my error message
> and they didn't realy help cuz I either needed the 'sa'
> password or I don't know how to impliment the solution
> based on my limited knowledge of SQL. I need to do a
> final backup to move all the info to a new machine with
> SQL 2000. I am really stuck (and screwed) if I can't get
> that info off cuz we just entered in a few hundred more
> employees so using an old backup isn't going to save me.
> Help would be greatly appreciated
|||Thanks for the post. It more or less led me to a
solution. I tried using NT authentication with no
success. Realized the machine was running on the admin
account with no password. For giggles I made a new admin
account with a different user name and an actual password
and tried again. Low and behold it worked. I got into
query analyzer and changed the sa password. Problem
solved. Thanks again.

>--Original Message--
>Hi,
>It seems the Login ID you are using is defaulted to the
database you have
>deleted. That is the reason you are getting the error.
>How to change the SA Password,
>1. Login to Query analyzer using Windows Authentication
>2. Execute the beloe command
> sp_password null,'passwordsa',sa
>(now the password for sa is passwordsa)
>How to change the default database of your existing
users, which gave error
>1. Login to query analyzer as SA
>2. execute below statement
> sp_defaultdb <loginame>,<new database name>
>3. After this you will be able to login using the old id
itself.
>Thanks
>Hari
>MCDBA
>
>
>"Brendan" <anonymous@.discussions.microsoft.com> wrote in
message
>news:124bf01c41152$811230e0$a501280a@.phx.gbl...
to
in
there
primary
file
Restored
to a
computer
Tried
and
Please
COMPUTER
my
the
and
tried
message
get
me.
>
>.
>

Can't connect to databases through Enterprise Manager

Understand I am not a DBA. I am just the guy who has to
work with this stuff.
We have client software that uses SQL 7 as a database.
Winpak is a door access software made by Northern. It
stores proxy card info, access levels, historys, etc. in
a SQL 7 database. I know the databases are still there
because Winpak connects and I can pull up info.
This started because I noticed whoever set up the primary
and archive databases pointed them both to the same file
name. I backed up the primary and deleted it. Restored
it with the full backup and made sure it was pointed to a
different file name. Everything worked fine and still
showed up in Enterprise Manager. I restarted the computer
later and tried to go back into Enterprise Manager. Tried
to expand 'SQL Server Group' to list all the databases and
I got an error saying, "A connection could not be
established to COMPUTER - Cannot open user default
database '<ID>'. Using master database instead. Please
verify SQL Server is running and check your SQL Server
registration properties (by right-clicking on the COMPUTER
node) and try again."
My services were running just fine and when I checked my
registration properties everything looked fine. Redid the
registration properties with no luck. Using NT
authentication and even making a new one. The other
problem is that somebody set this thing up 3 years ago and
I have no idea what the 'sa' password is and I have tried
every simple password I can think of. I am checked out
the knowledge database articles matching my error message
and they didn't realy help cuz I either needed the 'sa'
password or I don't know how to impliment the solution
based on my limited knowledge of SQL. I need to do a
final backup to move all the info to a new machine with
SQL 2000. I am really stuck (and screwed) if I can't get
that info off cuz we just entered in a few hundred more
employees so using an old backup isn't going to save me.
Help would be greatly appreciatedHi,
It seems the Login ID you are using is defaulted to the database you have
deleted. That is the reason you are getting the error.
How to change the SA Password,
1. Login to Query analyzer using Windows Authentication
2. Execute the beloe command
sp_password null,'passwordsa',sa
(now the password for sa is passwordsa)
How to change the default database of your existing users, which gave error
1. Login to query analyzer as SA
2. execute below statement
sp_defaultdb <loginame>,<new database name>
3. After this you will be able to login using the old id itself.
Thanks
Hari
MCDBA
"Brendan" <anonymous@.discussions.microsoft.com> wrote in message
news:124bf01c41152$811230e0$a501280a@.phx
.gbl...
> Understand I am not a DBA. I am just the guy who has to
> work with this stuff.
> We have client software that uses SQL 7 as a database.
> Winpak is a door access software made by Northern. It
> stores proxy card info, access levels, historys, etc. in
> a SQL 7 database. I know the databases are still there
> because Winpak connects and I can pull up info.
> This started because I noticed whoever set up the primary
> and archive databases pointed them both to the same file
> name. I backed up the primary and deleted it. Restored
> it with the full backup and made sure it was pointed to a
> different file name. Everything worked fine and still
> showed up in Enterprise Manager. I restarted the computer
> later and tried to go back into Enterprise Manager. Tried
> to expand 'SQL Server Group' to list all the databases and
> I got an error saying, "A connection could not be
> established to COMPUTER - Cannot open user default
> database '<ID>'. Using master database instead. Please
> verify SQL Server is running and check your SQL Server
> registration properties (by right-clicking on the COMPUTER
> node) and try again."
> My services were running just fine and when I checked my
> registration properties everything looked fine. Redid the
> registration properties with no luck. Using NT
> authentication and even making a new one. The other
> problem is that somebody set this thing up 3 years ago and
> I have no idea what the 'sa' password is and I have tried
> every simple password I can think of. I am checked out
> the knowledge database articles matching my error message
> and they didn't realy help cuz I either needed the 'sa'
> password or I don't know how to impliment the solution
> based on my limited knowledge of SQL. I need to do a
> final backup to move all the info to a new machine with
> SQL 2000. I am really stuck (and screwed) if I can't get
> that info off cuz we just entered in a few hundred more
> employees so using an old backup isn't going to save me.
> Help would be greatly appreciated|||Thanks for the post. It more or less led me to a
solution. I tried using NT authentication with no
success. Realized the machine was running on the admin
account with no password. For giggles I made a new admin
account with a different user name and an actual password
and tried again. Low and behold it worked. I got into
query analyzer and changed the sa password. Problem
solved. Thanks again.

>--Original Message--
>Hi,
>It seems the Login ID you are using is defaulted to the
database you have
>deleted. That is the reason you are getting the error.
>How to change the SA Password,
>1. Login to Query analyzer using Windows Authentication
>2. Execute the beloe command
> sp_password null,'passwordsa',sa
>(now the password for sa is passwordsa)
>How to change the default database of your existing
users, which gave error
>1. Login to query analyzer as SA
>2. execute below statement
> sp_defaultdb <loginame>,<new database name>
>3. After this you will be able to login using the old id
itself.
>Thanks
>Hari
>MCDBA
>
>
>"Brendan" <anonymous@.discussions.microsoft.com> wrote in
message
> news:124bf01c41152$811230e0$a501280a@.phx
.gbl...
to
in
there
primary
file
Restored
to a
computer
Tried
and
Please
COMPUTER
my
the
and
tried
message
get
me.
>
>.
>