Showing posts with label clients. Show all posts
Showing posts with label clients. Show all posts

Wednesday, March 21, 2012

How to enable clients to access the same DB via SQL Express

Hi to all!

My problem comes from this situation: I have two PC connected via a network calble; on the first I have SQL Server 2005 Express, an MDF data file in a shared directory under the "Document and Settings" path, and my program written in VB .NET 2005. On the second PC I have only my program, and I would like to have it connect to and work on the MDF on the first PC.

The program on the first PC works well and uses a connection string like the following:

Data Source=.\SQLEXPRESS;AttachDbFilename=<path>\<name>.mdf;;Integrated Security=True;User Instance=True

I am able to access to SQL Express from the second PC (I have enabled the Client to use the right TCP ports, told the firewall to let them work and enabled the Guest user on the first PC to use SQL Express), but from Visual Studio Server Explorer I cannot reach my data file: any attempt fails telling me that I cannot open it because is in a shared location... I can only open the DBs located in the "Data Directory" of SQL Express...

In other words, what should I do to have two or more clients work on the same DB under SQL Express? Is it mandatory that the DB .MDF file resides in the "C:\Programs\Microsoft SQL Server\MSSQL.1\MSSQL\Data" directory so that it can be permanently attached to SQL Express?

Thanks for your help!!!

Roberto

Permanently attaching the DB would be the easiest way to go. You do not have to have the mdf in SQL server data directory. You can put it on any local drive and attach it from there.

As connection string use Data Source=yourDBServer\SQLEXPRESS; Integrated Security=True

Do you have any concerns attaching the mdf permanently.

--
SvenC

|||Is it possible to put the mdf on a network drive? Using SQL Server Management Studio I can't: it lets me attach only mdf located in SQL Server data directory...|||

It would not be advised to have the file on a network share... I have not tested it, but I would think that the SQL Engine will not be able to connect to it (Using the T-SQL or GUI).

|||

It might work if you change the SQL service account, so that SQL Server runs in an account which has access rights to that share. Local System can only access local resources.

But you add a dependency, that the file server has to be always online otherwise SQL is down.

--
SvenC

|||

http://cyberblox.spaces.live.com/blog/cns!D0847CCE32E9987C!185.entry

How to email one set of data from app database.

Hi,
My vb.net app will use msde for database needs. The app is a tool in which the app user (companyA) will do some planning for their clients. So basically, the database will have information about all the clients (Sam, Julia, Peter, Nancy etc) of our cust
omer (companyA). Now suppose there is some error happening in the application for user Nancy, and we want the companyA to send us only Nancy's data so that we can duplicate the error and debug it. How do we do that...
In previous versions of our app where we used the flat files for data storage, we will just tell the companyA to email us Nancy.ourFile so that we can have a look at the data which is causing the problem. How to extract only Nancy's data from the whole d
atabase...
Thanks
dev
No replies anyone... Andrea/Aaron where are you all...
Thanks
dev
"dev_kh" wrote:

> Hi,
> My vb.net app will use msde for database needs. The app is a tool in which the app user (companyA) will do some planning for their clients. So basically, the database will have information about all the clients (Sam, Julia, Peter, Nancy etc) of our cu
stomer (companyA). Now suppose there is some error happening in the application for user Nancy, and we want the companyA to send us only Nancy's data so that we can duplicate the error and debug it. How do we do that...
> In previous versions of our app where we used the flat files for data storage, we will just tell the companyA to email us Nancy.ourFile so that we can have a look at the data which is causing the problem. How to extract only Nancy's data from the whole
database...
> Thanks
> dev
sql

Sunday, February 19, 2012

how to do backup of msde?

hello,
we use Protection Pilot (from McAffee), it installs a MSDE that it uses
to store info about clients.
so, I need to do a backup of the MSDE to send to their tech support
people but their backup utility isn't working.
They've tried for about 2 weeks now and it's not working.
I asked the tech person about doing backup via command line and she
looked into it, but it started asking for password!
Neither of use knew about any MSDE passwords, so that didn't work either.
I figured I'd ask here, what is a quick/easy way to do a backup of a
MSDE via command line (taking into consideration I don't know what
password it's asking for). I guess the sa account can be used, but how
can I reset that account's password so the backups will work?
thanks,
dave
In message <#3qDpRkjFHA.1204@.TK2MSFTNGP12.phx.gbl>, pheonix1t
<nothing@.nothing.gone> writes
>hello,
>we use Protection Pilot (from McAffee), it installs a MSDE that it uses
>to store info about clients.
>so, I need to do a backup of the MSDE to send to their tech support
>people but their backup utility isn't working.
>They've tried for about 2 weeks now and it's not working.
>I asked the tech person about doing backup via command line and she
>looked into it, but it started asking for password!
>Neither of use knew about any MSDE passwords, so that didn't work either.
This sounds a little fishy if you ask me.
The instance of MSDE they installed for use with their software must
have got one or more user accounts assigned to it and these have
probably been assigned passwords. At a very minimum it MUST have an "sa"
user account. If your normal PC's Administrator password does not work
then it would suggest MSDE is running in SQL User Only mode. This then
brings the point that McAffee MUST know the passwords used when
installing and configuring the installation. It is therefore more likely
that they do NOT want to tell YOU (probably for very good reasons,
however, if their own tools ain't working ...).

>I figured I'd ask here, what is a quick/easy way to do a backup of a
>MSDE via command line (taking into consideration I don't know what
>password it's asking for). I guess the sa account can be used, but how
>can I reset that account's password so the backups will work?
>thanks,
>dave
One possible solution would be to use OSQL to detach their database from
the instance of MSDE and then send them the MDF & LDF files (they will
need both). They could then re-attach the database at their end to fix
the problems.
Another, slightly more risky move, would be to stop MSDE from running
(ie: NET STOP [services]) and then copy the MDF and LDF files to them.
Again, they will need both files. Don't forget to restart the MSDE
services after the files have been copied.
Andrew D. Newbould E-Mail: newsgroups@.NOSPAMzadsoft.com
ZAD Software Systems Web : www.zadsoft.com
|||hi Dave,
pheonix1t wrote:
> hello,
> we use Protection Pilot (from McAffee), it installs a MSDE that it
> uses to store info about clients.
> so, I need to do a backup of the MSDE to send to their tech support
> people but their backup utility isn't working.
> They've tried for about 2 weeks now and it's not working.
> I asked the tech person about doing backup via command line and she
> looked into it, but it started asking for password!
> Neither of use knew about any MSDE passwords, so that didn't work
> either.
> I figured I'd ask here, what is a quick/easy way to do a backup of a
> MSDE via command line (taking into consideration I don't know what
> password it's asking for). I guess the sa account can be used, but
> how can I reset that account's password so the backups will work?
if they did not deny access to the MSDE instance to local administrators you
can log in as one of them and connect to the instance via a trusted
connection, not requiring a standard SQL Server login's password...
once connected (for instance via oSql.exe command line utility,
http://msdn.microsoft.com/library/de..._osql_1wxl.asp ,
http://support.microsoft.com/default...;EN-US;q325003)
c:\...\osql.exe -E
you get a command prompt like
1>
where you can execute the backup statement as desired...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Why is it more risky to copy the files after stopping the server, rather than
after a detach. I am asking because I want to in part use this as a method
for backup and restore.
Periodically, I want to take copies of the mdf and log files for later
attachment under a new database name - but without detaching the existing
database. So since I will stop the server anyway during backup, I thought it
unnecessary to go through an extra step of detach/attach of the original that
still need to run after the backup.
Regards
Bo
"Andrew D. Newbould" wrote:

> In message <#3qDpRkjFHA.1204@.TK2MSFTNGP12.phx.gbl>, pheonix1t
> <nothing@.nothing.gone> writes
> This sounds a little fishy if you ask me.
> The instance of MSDE they installed for use with their software must
> have got one or more user accounts assigned to it and these have
> probably been assigned passwords. At a very minimum it MUST have an "sa"
> user account. If your normal PC's Administrator password does not work
> then it would suggest MSDE is running in SQL User Only mode. This then
> brings the point that McAffee MUST know the passwords used when
> installing and configuring the installation. It is therefore more likely
> that they do NOT want to tell YOU (probably for very good reasons,
> however, if their own tools ain't working ...).
>
> One possible solution would be to use OSQL to detach their database from
> the instance of MSDE and then send them the MDF & LDF files (they will
> need both). They could then re-attach the database at their end to fix
> the problems.
> Another, slightly more risky move, would be to stop MSDE from running
> (ie: NET STOP [services]) and then copy the MDF and LDF files to them.
> Again, they will need both files. Don't forget to restart the MSDE
> services after the files have been copied.
> --
> Andrew D. Newbould E-Mail: newsgroups@.NOSPAMzadsoft.com
> ZAD Software Systems Web : www.zadsoft.com
>
|||I can't give you a complete answer as there are others better suited to
explain however in general terms when you detach a database the logs
files are flushed, statistics updated and completed transactions
committed to the database. In other words a clean-up process is
performed ready to transport the database.
When you stop the server processes the clean-up routines are not
performed to the extent that a detach does. The idea being the server
can continue where it left off when it comes back on-line.
In my experience most backup regimes involve stopping the server
processes, backing up all MDF & LDF database files required and then
restarting the server processes. This tends to be a faster process than
scheduling backups to tape etc and causes the databases to be off-line
for the shortest periods.
Don't get me wrong, you can do on-line backups as well via Enterprise
Manager but many DBA's I know won't trust the scheduling as it can get
broken. Some backup software like Veritas can perform on-line backups as
well however be careful in your choice as some only backup the DATA and
not the Structure etc so in a failure situation its no good restoring
data when you don't have the correct structure first.
Kind Regards
Andrew D. Newbould
In message <F662A14E-E095-437D-BC05-0958E00BD903@.microsoft.com>, bo
<bo@.discussions.microsoft.com> writes[vbcol=seagreen]
>Why is it more risky to copy the files after stopping the server, rather than
>after a detach. I am asking because I want to in part use this as a method
>for backup and restore.
>Periodically, I want to take copies of the mdf and log files for later
>attachment under a new database name - but without detaching the existing
>database. So since I will stop the server anyway during backup, I thought it
>unnecessary to go through an extra step of detach/attach of the original that
>still need to run after the backup.
>Regards
>Bo
>"Andrew D. Newbould" wrote:
Andrew D. Newbould E-Mail: newsgroups@.NOSPAMzadsoft.com
ZAD Software Systems Web : www.zadsoft.com