Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Thursday, March 29, 2012

Embedding/Distributing SQL Express With A VB Program

If I want to distribute a VB database programm using MSDE I have to install MSDE seperately which can be a challenge for some users. It there a way I could deploy SQL Express with my VB program so the user would not have to do a seperate install? Is this possible in Visual Studio 2003 or do I need 2005?

Thanks

Have a look at the following MSDN Article, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsse/html/EmSQLExCustApp.asp

sql

Embedding SQL Server Express in the installer

Can we embed the SQL Server Express in the windows installer jsut like the XML files or the Ms access database?You are referring to the windows installer in VS 2005 I suppose ??
It is not possible in the installer of VS 2003, but I suppose it can be done with Whidbey ... I haven't tried it yet though ...|||The following information may provide clarification regarding the same;

Can I redistribute SQL Express?
http://blogs.msdn.com/sqlexpress/archive/2004/07/04/172952.aspx

Embedded SQL Server Express Deployment - Unhandled Exception: Database already exists

Good Afternoon.

I am trying to write a short application within which I would like to embed a SQL Server Express database, all of which would be deployed via ClickOnce through a web site. The installation process seems to be working without trouble, including installation of the .NET Framework 2.0 and SQL Server Express 2005.

When the application launches on the new machine, however, I get a big Microsoft .NET Framework "Unhandled exception" error dialog box that indicates the database already exists and that the database file could not be attached. I am working with a clean virtual machine that I know has never had the database installed on it.

I fear I am overlooking something quite straightforward, but since this is the first time I have ever attempted to build a data-bound application, I am not sure where I am going wrong.

Perhaps the source of the problem, or a related problem, might be revealed even when I run the application in debug mode from within Visual Studio. I can run the application once, but if I try to run it again, I get an error when I try to open the database connection that is similar in content (database already exists...could not attach). I can run the SSEUtil and detach the database and then run the application again in debug mode and it works no problem (the first time!).

Lastly, if I install the application on the machine on which it was developed and make sure the database is detached, it will run without any trouble (even repeatedly). But, on a new blank machine, there is no database listed that matches my database name, so I cannot try to detach anything!?

My apologies for such a novice question!

Sean

Hi Sean,

I would suggest removing the ‘Initial Catalog’ keyword from your connection string. Among the things that are stored about a database when it is attached is the Name/Path pairing; SQL Server gets a little upset if you try to attach a database using an existing name but with a different path. Enter the |DataDirectory| macro…

I’m guessing you’re using ClickOnce deployment for this application. There are things that will cause the install directory of a ClickOnce deployment to move, when this happens, VS magically fixes up things as far as the application goes, but it cannot fix up the fact that SQL Server has recorded your explicit database as being linked to the old file location. When you attempt to open the application now, the attach fails because there is already a database named JMU_2007 listed in the master database, but it is associated with a different path, so you get the error that the database already exists. I’m guessing this is the problem you’re hitting.

By removing the ‘Initial Catalog’ keyword, you’re forcing SQL Express to give the database an autoname based on its path. If the database moves as a result of VS behavior, the name will be changed because the path has changed, so it will appear to be a different database from the SQL perspective. Hopefully this helps.

Mike

|||

Thanks very much Mike. That did the trick...I can't believe I overlooked that after spending too much time trying to fix this problem.

Sean

Tuesday, March 27, 2012

embedded deployment sql server express

Hi,my problem is the following

I can not completely understand how to deploy sse with my application

To some degree I understand the explaning in Mikes Documentation

Things I don't get:

1)Do I not check the prerequisite server express because when I did and run the setup.exe that I build the thing that happens is that the sql package gets unpacked over and over along with a little message that it's taking a little longer then expected. I gues this is the fallpit where the actual setup.exe for sse is nothing being done with hence the wrapper.

A quote from Mikes document "If the VS Bootstrapper isn't flexible enough for you then". Well, I don't know what I'am doing wrong but it doesn't work at all. I had no problem with the other prerequisites (Framework, installer)

Back to the first question: if so do I manually add the SQLEXP.EXE (downloaded from the internet) or is it the sqlexpr32.exe in the same folder as the setup.exe for the application?

2) How is the wrapper invoked? I don't see that mentioned. I thought when you start the application itself, but that hardly seems logical.

Please anyone, give me some clear directions or additional expanatory

Thanks,

Richard

Hi Richard,

I've never heard of the problem you are encountering where the package gets unpacked over and over. You should test if this is specifically related to how the VS Bootstrapper is calling the package by trying to manually install SQL Express on the problem computer. Try copying the SQLEXPR32.EXE file from the folder where you setup.exe lives to the computer and just double-click on it directly to do a manual install.

Is this problem happening on more than one computer? This seems like it is going to be machine specific and is related to some configuration on the computer that we don't know about. Test your installation on a few other computers to see if the problem can be reproduced.

As far as calling the wrapper, normally the wrapper is what you run and it calls other things. Basically, a wrapper would call the SQL Express installation and then it would call the installation of your custom application. The wrapper replaces your current setup.exe program, which is actuall a wrapper as well. I don't think you need to write a customer wrapper since the problem here is how the SQL installer is executing, you need to figure out if the SQL installer problem is machine specific or not first.

Mike

|||

thanks for the reply,

on it's own it installed fine, but now I'am in the process of uninstalling it and I can't seem to get rid of it. ADD/REMOVE progams doesn't work. Any suggestions?

Anyway I'am going to assume that the deployment is suppose to work fine like you said. That's why I go forward and ask you the question how you can make the prerequisites do a silent install. In particulary the sse. I don't realy grasp the concept off passing arguments to the setup program. How and from where is that code beiing executed?

Before I am going to ask you the shirt of your back I wanted to know what a good book is to learn the concepts of working with sse and a desktop application. Would you suggest ADO.net the core essentials from microsoft press?

Richard

|||

as I stated in my last reply, I deployed my application to my newly installed xp pro laptop

Now, that I want to testdrive my database application I get this error:

An attempt to attach an auto-named database file c:/program files........................\MyDB.mdf failed. A database with the same name exists, or specified file can not be opened, or it is located on UNC share.

This is what I read in my app.config file;

<connectionStrings>

<add name="MasterDetail.My.MySettings.MyDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MyDB.mdf;Integrated Security=True;User Instance=True"

providerName="System.Data.SqlClient" />

</connectionStrings>

What could I be doing wrong?

Richard

|||

Richard777 wrote:

I can't seem to get rid of it. ADD/REMOVE progams doesn't work. Any suggestions?

Odd, it's always worked for me. SQL Server uses a single ARP entry for all copies of SQL Server 2005, this includes multiple Editions and Instances. You need to ensure that you uncheck all the components you wish to remove once you've selected the instance you want to remove. There are also some components that have to be removed separately; I recall that the Setup Components are one of them, but I can't recal the others.

Richard777 wrote:

Anyway I'am going to assume that the deployment is suppose to work fine like you said. That's why I go forward and ask you the question how you can make the prerequisites do a silent install. In particulary the sse. I don't realy grasp the concept off passing arguments to the setup program. How and from where is that code beiing executed?

If you are using ClickOnce to deploy SSE it should already be doing a quite install for the prerequisites. The arguments for each prerequsite are part of the manifest for that prerequiste that is installed by VS. If you are trying to write your own command line you need to use the /qn argument to cause a quite install. There is more information about configuring SSE during install in the FAQ that you can find at the top of this forum.

Richard777 wrote:

Before I am going to ask you the shirt of your back I wanted to know what a good book is to learn the concepts of working with sse and a desktop application. Would you suggest ADO.net the core essentials from microsoft press?

I've not read that book specifically. I have been through part of ADO.NET 2.0 Step by Step and it seems alright. There are also many learning videos available for free on the Microsoft web site, start here (C# or VB.NET) to see if there is anything interesting to you. You might also be interested in the ADO.NET sections of the MSDN Library, which is here.

Mike

|||

Is there anywhere we can get a description of "the manifest for that prerequiste that is installed by VS"

I would like to specify the ADDLOCAL and SQL Signon stuff. Do you have any examples of how to make and include a manifest for these things.

Thanks

Ciaran

|||

Hi Ciaran,

There are a number of documents on MSDN that discuss the Bootstrapper:

http://msdn2.microsoft.com/en-us/library/aa730839(vs.80).aspx
http://msdn2.microsoft.com/en-us/library/ms165429(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/ms229223(VS.80).aspx
http://msdn.microsoft.com/msdnmag/issues/04/10/bootstrapper/

Those documents will tell you enough to read the manifests that are installed by VS, we don't have specific documentation on the individual manifests, but they're XML, so they're pretty much self documenting.

Mike

embed SQL Express in app

I'm new to SQL Sever Express and wondering about using it for a desktop app.
I have a web server and SQL2005 with some web apps, and I'm thinking about
making desktop versions of some.
But, I want to protect the db structure and the way everything hangs
together. Assuming I can make a SQL Express version of the 2005 db, can I
combine that with something like a Flash front end and distribute it to
desktops without risking nosy people looking into what make them tick?
What would be great would be encryption of the db, and some lock to prevent
people from opening it in Enterprise mgr/SQL mgr.
CS
hi,
catsailor wrote:
> I'm new to SQL Sever Express and wondering about using it for a
> desktop app. I have a web server and SQL2005 with some web apps, and
> I'm thinking about making desktop versions of some.
> But, I want to protect the db structure and the way everything hangs
> together. Assuming I can make a SQL Express version of the 2005 db,
> can I combine that with something like a Flash front end and
> distribute it to desktops without risking nosy people looking into
> what make them tick?
> What would be great would be encryption of the db, and some lock to
> prevent people from opening it in Enterprise mgr/SQL mgr.
> CS
http://msdn.microsoft.com/library/de...xpuserinst.asp
http://msdn.microsoft.com/library/de...LExCustApp.asp
as regards encrition, you can use the native features provided by SQL Server
2005 it self, as indicated in
http://msdn.microsoft.com/msdnmag/is...s/default.aspx
http://msdn2.microsoft.com/en-us/library/ms189586.aspx
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.18.0 - DbaMgr ver 0.62.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thanks very much for the articles. I have read through them quickly and see
that I may be able to embed an SQL Express db in my app, and I can encrypt
the data.
But, if a user had Admin privileges and SQL Server Management Studio,
couldn't she still open the SQL Express db and see the structure? Is there
any way to prevent anyone but me from opening the db at all, even if they
are sa?
CS
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:47q45jFgufr7U1@.individual.net...
> hi,
> catsailor wrote:
> http://msdn.microsoft.com/library/de...xpuserinst.asp
> http://msdn.microsoft.com/library/de...LExCustApp.asp
> as regards encrition, you can use the native features provided by SQL
> Server 2005 it self, as indicated in
> http://msdn.microsoft.com/msdnmag/is...s/default.aspx
> http://msdn2.microsoft.com/en-us/library/ms189586.aspx
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.18.0 - DbaMgr ver 0.62.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||hi,
catsailor wrote:
> Thanks very much for the articles. I have read through them quickly
> and see that I may be able to embed an SQL Express db in my app, and
> I can encrypt the data.
> But, if a user had Admin privileges and SQL Server Management Studio,
> couldn't she still open the SQL Express db and see the structure? Is
> there any way to prevent anyone but me from opening the db at all,
> even if they are sa?
the encription protection available in SQL Server 2005 is for data only...
at the schema level you can prevent, via GRANT/DENY statement permissions on
"VIEW DEFINITION" at the objects level as at the schema level it self,
http://msdn2.microsoft.com/en-us/library/ms176128(SQL.90).aspx , but a
sysadmin member can not be cut off...
you say:
>Is
> there any way to prevent anyone but me from opening the db at all,
> even if they are sa?
but ... "who are you?"... when you distribute a database to end users they
will not care about "you"... their system will care about their
acconts/logins... or better.. their principals
(http://msdn2.microsoft.com/en-us/library/ms181127(SQL.90).aspx)... and you
will not be enlisted there at all..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.18.0 - DbaMgr ver 0.62.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||I think if you carry this through to it's logical conclusion you won't want
to totally block access. If you did, that would mean you would be
responsible for all backup and restore, maintenance, patching, upgrading,
etc. If the customer had a SQL Server problem, you would have to fix it
because CSS wouldn't be able to access their database to fix it. Are you
really willing to sign up for that?
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
"catsailor" <hullflyer at gmail.com> wrote in message
news:e27f3$441833a9$48f535c4$29530@.msgid.meganewss ervers.com...
> Thanks very much for the articles. I have read through them quickly and
> see that I may be able to embed an SQL Express db in my app, and I can
> encrypt the data.
> But, if a user had Admin privileges and SQL Server Management Studio,
> couldn't she still open the SQL Express db and see the structure? Is
> there any way to prevent anyone but me from opening the db at all, even if
> they are sa?
> CS
> "Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
> news:47q45jFgufr7U1@.individual.net...
>
|||yeppers, that would be part of the deal.
CS
"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:OfVy9NGSGHA.4944@.TK2MSFTNGP10.phx.gbl...
>I think if you carry this through to it's logical conclusion you won't want
>to totally block access. If you did, that would mean you would be
>responsible for all backup and restore, maintenance, patching, upgrading,
>etc. If the customer had a SQL Server problem, you would have to fix it
>because CSS wouldn't be able to access their database to fix it. Are you
>really willing to sign up for that?
> --
> 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
> "catsailor" <hullflyer at gmail.com> wrote in message
> news:e27f3$441833a9$48f535c4$29530@.msgid.meganewss ervers.com...
>

Monday, March 19, 2012

EMAIL from SQL express

Hello

Just figured out that database mail is not available in SQL Express.
Anyone have any ideas on how I can send mail from sql express ... as
part of a trigger ?

Regards

RobOn Thu, 6 Dec 2007 10:52:46 -0800 (PST), roblowein
<rob.lowein@.gmail.comwrote:

All versions of SQL Server have support for Common Language Runtime
and .NET Integration. So you could write a .NET assembly to send
emails.

-Tom.

Quote:

Originally Posted by

>Hello
>
>Just figured out that database mail is not available in SQL Express.
>Anyone have any ideas on how I can send mail from sql express ... as
>part of a trigger ?
>
>Regards
>
>Rob

|||On Dec 7, 4:41 am, Tom van Stiphout <no.spam.tom7...@.cox.netwrote:

Quote:

Originally Posted by

On Thu, 6 Dec 2007 10:52:46 -0800 (PST), roblowein
>
<rob.low...@.gmail.comwrote:
>
All versions of SQL Server have support for Common Language Runtime
and .NET Integration. So you could write a .NET assembly to send
emails.
>
-Tom.
>
>
>

Quote:

Originally Posted by

Hello


>

Quote:

Originally Posted by

Just figured out that database mail is not available in SQL Express.
Anyone have any ideas on how I can send mail from sql express ... as
part of a trigger ?


>

Quote:

Originally Posted by

Regards


>

Quote:

Originally Posted by

Rob- Hide quoted text -


>
- Show quoted text -


Thanks for the reply.... could provide any more details ... this
quite new to me

THansk

Rob|||On Dec 6, 10:41 pm, Tom van Stiphout <no.spam.tom7...@.cox.netwrote:

Quote:

Originally Posted by

On Thu, 6 Dec 2007 10:52:46 -0800 (PST), roblowein
>
<rob.low...@.gmail.comwrote:
>
All versions of SQL Server have support for Common Language Runtime
and .NET Integration. So you could write a .NET assembly to send
emails.
>
-Tom.
>
>
>

Quote:

Originally Posted by

Hello


>

Quote:

Originally Posted by

Just figured out that database mail is not available in SQL Express.
Anyone have any ideas on how I can send mail from sql express ... as
part of a trigger ?


>

Quote:

Originally Posted by

Regards


>

Quote:

Originally Posted by

Rob- Hide quoted text -


>
- Show quoted text -


Tom, I too am interested in some type of example. Do you do
development work in a language - VB, C#, Delphi or other?

Thanks|||On Sun, 9 Dec 2007 08:01:36 -0800 (PST), scoots987
<scoots987@.gmail.comwrote:

In Books Online, the topic "CLR [SQL Server] about CLR integration
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/denet9/html/c73e628a-f54a-411a-bfe3-6dae519316cc.htm
has a simple "Hello World" example.

-Tom.

Quote:

Originally Posted by

>On Dec 6, 10:41 pm, Tom van Stiphout <no.spam.tom7...@.cox.netwrote:

Quote:

Originally Posted by

>On Thu, 6 Dec 2007 10:52:46 -0800 (PST), roblowein
>>
><rob.low...@.gmail.comwrote:
>>
>All versions of SQL Server have support for Common Language Runtime
>and .NET Integration. So you could write a .NET assembly to send
>emails.
>>
>-Tom.
>>
>>
>>

Quote:

Originally Posted by

>Hello


>>

Quote:

Originally Posted by

>Just figured out that database mail is not available in SQL Express.
>Anyone have any ideas on how I can send mail from sql express ... as
>part of a trigger ?


>>

Quote:

Originally Posted by

>Regards


>>

Quote:

Originally Posted by

>Rob- Hide quoted text -


>>
>- Show quoted text -


>
>Tom, I too am interested in some type of example. Do you do
>development work in a language - VB, C#, Delphi or other?
>
>Thanks
>