BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Deploying SQL Express?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Rob Uttley
Guest





PostPosted: Fri May 04, 2007 1:19 pm    Post subject: Deploying SQL Express? Reply with quote



Has anyone got experience deploying SQL Express onto end-users machines?
I'm very used to doing this kind of thing with Interbase, where I can
write an installer to install the server as necessary, install the client
connection stuff (if necessary), install my Delphi app and install a file
containing the database. Piece of cake.

I keep going round in circles with SQL Express - is there an easy way to
bundle up the server software, my Delphi application and a database file
so that I can give an end-user a CD and let them get on with it? I keep
finding MSDN references that leave me feeling like I'm supposed to get the
end-user to install the server software separately from my application,
and then that I have to jump through further hoops to get an existing
database file up and running. I installed Visual Studio 2005 as I thought
this might give me a 'database project deployment' option that I could
trick into deploying my Delphi exe, but I can't see any obvious way to do
this from the VS front-end either.

I guess I'm just looking for a tutorial or a push in the right
direction... at the moment I've split out the contents of SQLEXPR32 into a
folder and I'm looking at controlling what/how it installs via some
commandline options, but I'm a little concerned about the Windows 3.x
installer and .Net 2.0 framework pre-requirements on the end-users
machine.

Any suggestions or links would be really appreciated.
Thanks,
Rob
Back to top
Rob Uttley
Guest





PostPosted: Fri May 04, 2007 2:04 pm    Post subject: Re: Deploying SQL Express? Reply with quote



In article <2vdm33hb9837u4jp9n805sh3c6g1u246d5 (AT) 4ax (DOT) com>,
dontbother (AT) emailingme (DOT) com (CC) wrote:

Quote:
What you're trying to do is probably not legal. Bundling somebody
else's software with yours is probably against the EUL.

Uh... with respect, are you possibly confusing SQL Express with another
product? SQL Express is what used to be known as MSDE, the redistributable
cut-down SQL Server engine. I have Visual Studio 2005 and from what I can
make of the documentation, Microsoft are fine with me developing solutions
that use SQL Express and distributing it, as part of my own solution, out
to my customers.

I can see how opening up the Microsoft installer might not be legal, but
I'm there at the moment in desperation - I'm not trying to do anything out
of the spirit of the re-distribution of SQL Express as far as I can see.

I'm just trying to find a way to install SQL Express, and my application,
and a database file, in a single GUI-based installer. My application
happens to be written in Delphi, but could be written in VB/C# etc as far
as the database server is concerned. Everything I've seen on the MSDN
seems to be pushing me to getting the end-user to download SQL Express
from Microsoft then run my own installer to add my application and
possibly configure a database, and I just want a simple self-contained
installer that I can put on a CD and doesn't require web-access or
35Mb-downloads.

Many thanks
Rob
Back to top
Rob Uttley
Guest





PostPosted: Fri May 04, 2007 4:22 pm    Post subject: Re: Deploying SQL Express? Reply with quote



Thanks Brian - that is helpful. I wonder why I didn't find this when I was
searching the documentation earlier.

One trick I found buried in the documentation was the use of the
commandline option /x to get MS's installer to spit the contents of the
package into a folder (rather than into a temporary folder that you can't
get to, which it what it does by default)
ie "SQLEXPR32 /X" will get you a prompt, into which you can select a
folder.

In light of your second post, I'll keep you informed about how I get on.
My ideal would be;

1) check that the user had local admin rights
2) check that .net 2.0 framework is installed
3) install SQL Express onto the machine
4) deploy a pre-populated database (ie, it contains some info already)
5) install my Delphi application
6) reboot (I presume it will probably be necessary!)
7) (having previously set-up RunOnce) try to get my app started.

All being well I can do this easily either from Wise (which I know
quite well) or by some fairly-painless-process using Visual Studio 2005.
:-)

I know, I know - I'm an optimist!

Kind regards
Rob


In article <463b5b10$1 (AT) newsgroups (DOT) borland.com>,
bhollisterATfuturaintlDOTcom (Brian Hollister) wrote:

Quote:
This article covers how to install from the command prompt,
http://msdn2.microsoft.com/en-us/library/ms144259.aspx#installationscrip
ts.

Maybe you can use this info to help,

Brian

--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
"Rob Uttley" <rob (AT) robsoft (DOT) co.uk> wrote in message
news:memo.20070504150459.3652B (AT) robsoft (DOT) compulink.co.uk...
In article <2vdm33hb9837u4jp9n805sh3c6g1u246d5 (AT) 4ax (DOT) com>,
dontbother (AT) emailingme (DOT) com (CC) wrote:

What you're trying to do is probably not legal. Bundling somebody
else's software with yours is probably against the EUL.

Uh... with respect, are you possibly confusing SQL Express with
another
product? SQL Express is what used to be known as MSDE, the
redistributable
cut-down SQL Server engine. I have Visual Studio 2005 and from what I
can
make of the documentation, Microsoft are fine with me developing
solutions
that use SQL Express and distributing it, as part of my own solution,
out
to my customers.

I can see how opening up the Microsoft installer might not be legal,
but
I'm there at the moment in desperation - I'm not trying to do
anything out
of the spirit of the re-distribution of SQL Express as far as I can
see.

I'm just trying to find a way to install SQL Express, and my
application,
and a database file, in a single GUI-based installer. My application
happens to be written in Delphi, but could be written in VB/C# etc as
far
as the database server is concerned. Everything I've seen on the MSDN
seems to be pushing me to getting the end-user to download SQL Express
from Microsoft then run my own installer to add my application and
possibly configure a database, and I just want a simple self-contained
installer that I can put on a CD and doesn't require web-access or
35Mb-downloads.

Many thanks
Rob


Back to top
CC
Guest





PostPosted: Fri May 04, 2007 6:42 pm    Post subject: Re: Deploying SQL Express? Reply with quote

On Fri, 4 May 2007 14:19 +0100 (BST), rob (AT) robsoft (DOT) co.uk (Rob Uttley)
wrote:

Quote:
I guess I'm just looking for a tutorial or a push in the right
direction... at the moment I've split out the contents of SQLEXPR32 into a
folder and I'm looking at controlling what/how it installs via some
commandline options, but I'm a little concerned about the Windows 3.x
installer and .Net 2.0 framework pre-requirements on the end-users
machine.

What you're trying to do is probably not legal. Bundling somebody
else's software with yours is probably against the EUL.
Back to top
Brian Hollister
Guest





PostPosted: Fri May 04, 2007 9:11 pm    Post subject: Re: Deploying SQL Express? Reply with quote

This article covers how to install from the command prompt,
http://msdn2.microsoft.com/en-us/library/ms144259.aspx#installationscripts.

Maybe you can use this info to help,

Brian

--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
"Rob Uttley" <rob (AT) robsoft (DOT) co.uk> wrote in message
news:memo.20070504150459.3652B (AT) robsoft (DOT) compulink.co.uk...
Quote:
In article <2vdm33hb9837u4jp9n805sh3c6g1u246d5 (AT) 4ax (DOT) com>,
dontbother (AT) emailingme (DOT) com (CC) wrote:

What you're trying to do is probably not legal. Bundling somebody
else's software with yours is probably against the EUL.

Uh... with respect, are you possibly confusing SQL Express with another
product? SQL Express is what used to be known as MSDE, the redistributable
cut-down SQL Server engine. I have Visual Studio 2005 and from what I can
make of the documentation, Microsoft are fine with me developing solutions
that use SQL Express and distributing it, as part of my own solution, out
to my customers.

I can see how opening up the Microsoft installer might not be legal, but
I'm there at the moment in desperation - I'm not trying to do anything out
of the spirit of the re-distribution of SQL Express as far as I can see.

I'm just trying to find a way to install SQL Express, and my application,
and a database file, in a single GUI-based installer. My application
happens to be written in Delphi, but could be written in VB/C# etc as far
as the database server is concerned. Everything I've seen on the MSDN
seems to be pushing me to getting the end-user to download SQL Express
from Microsoft then run my own installer to add my application and
possibly configure a database, and I just want a simple self-contained
installer that I can put on a CD and doesn't require web-access or
35Mb-downloads.

Many thanks
Rob
Back to top
Brian Hollister
Guest





PostPosted: Fri May 04, 2007 9:11 pm    Post subject: Re: Deploying SQL Express? Reply with quote

BTW, i have not done this yet but will be in the next few weeks as our port
poroject gets nearer to an end...So i am very interested in how this turns
out for you....


brian

--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
"Brian Hollister" <bhollisterATfuturaintlDOTcom> wrote in message
news:463b5b10$1 (AT) newsgroups (DOT) borland.com...
Quote:
This article covers how to install from the command prompt,

http://msdn2.microsoft.com/en-us/library/ms144259.aspx#installationscripts.

Maybe you can use this info to help,

Brian

--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
"Rob Uttley" <rob (AT) robsoft (DOT) co.uk> wrote in message
news:memo.20070504150459.3652B (AT) robsoft (DOT) compulink.co.uk...
In article <2vdm33hb9837u4jp9n805sh3c6g1u246d5 (AT) 4ax (DOT) com>,
dontbother (AT) emailingme (DOT) com (CC) wrote:

What you're trying to do is probably not legal. Bundling somebody
else's software with yours is probably against the EUL.

Uh... with respect, are you possibly confusing SQL Express with another
product? SQL Express is what used to be known as MSDE, the
redistributable
cut-down SQL Server engine. I have Visual Studio 2005 and from what I
can
make of the documentation, Microsoft are fine with me developing
solutions
that use SQL Express and distributing it, as part of my own solution,
out
to my customers.

I can see how opening up the Microsoft installer might not be legal, but
I'm there at the moment in desperation - I'm not trying to do anything
out
of the spirit of the re-distribution of SQL Express as far as I can see.

I'm just trying to find a way to install SQL Express, and my
application,
and a database file, in a single GUI-based installer. My application
happens to be written in Delphi, but could be written in VB/C# etc as
far
as the database server is concerned. Everything I've seen on the MSDN
seems to be pushing me to getting the end-user to download SQL Express
from Microsoft then run my own installer to add my application and
possibly configure a database, and I just want a simple self-contained
installer that I can put on a CD and doesn't require web-access or
35Mb-downloads.

Many thanks
Rob

Back to top
Pepe Taboada
Guest





PostPosted: Sat May 05, 2007 6:08 pm    Post subject: Re: Deploying SQL Express? Reply with quote

Rob, just for the sake of it. Is you app a win32 or .Net app.
I'm writting one in Delphi also, a Win32 app, and found that when you deploy
you app you can't attach your database to SQL Express with code unless your
app is a .NET app.
Thanks
Pepe
Back to top
CC
Guest





PostPosted: Sat May 05, 2007 7:13 pm    Post subject: Re: Deploying SQL Express? Reply with quote

On Sat, 5 May 2007 09:08:32 -0400, "Pepe Taboada" <pepet (AT) laminall (DOT) com>
wrote:

Quote:
Rob, just for the sake of it. Is you app a win32 or .Net app.
I'm writting one in Delphi also, a Win32 app, and found that when you deploy
you app you can't attach your database to SQL Express with code unless your
app is a .NET app.

Please show this with code.
Back to top
Brian Hollister
Guest





PostPosted: Sat May 05, 2007 7:14 pm    Post subject: Re: Deploying SQL Express? Reply with quote

Pepe,

<cut>you can't attach your database to SQL Express with code </cut>

Do you mean that you cannot open a connection to it or do you mean that you
cannot run sp_attach_db?

Thanks,

brian


--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
"Pepe Taboada" <pepet (AT) laminall (DOT) com> wrote in message
news:463c81d4$1 (AT) newsgroups (DOT) borland.com...
Quote:
Rob, just for the sake of it. Is you app a win32 or .Net app.
I'm writting one in Delphi also, a Win32 app, and found that when you
deploy
you app you can't attach your database to SQL Express with code unless
your
app is a .NET app.
Thanks
Pepe

Back to top
Pepe Taboada
Guest





PostPosted: Sun May 06, 2007 1:52 am    Post subject: Re: Deploying SQL Express? Reply with quote

Brian,
I mean I can't use, sp_attach_db, in my Win32 app. Since my customer is
local on the first day I attached the database manually and put this code in
the Main's form create event:

if ADOConnection1.ConnectionString = '' then
begin
ConnecString := 'Provider=SQLOLEDB.1; Integrated Security=SSPI; Persist
Security Info=False; Initial Catalog=QnsContract; Data Source=.\SQLEXPRESS';
ADOConnection1.ConnectionString := PromptDataSource(Handle, ConnecString);
ADOConnection1.Connected := True;
end;//if ADOConnection1.ConnectionString = '' then

As you can imagine this would no be convinient if my customer were across
the country. I remembering reading somewhere in Microsoft's web site
something that said you can only use "sp_attach_db" on .NET apps.
If you have any solutions to my problem on suggestion I would greatly
appreciated
Thanks
Pepe
Back to top
Brian Hollister
Guest





PostPosted: Sun May 06, 2007 1:54 am    Post subject: Re: Deploying SQL Express? Reply with quote

Pepe,

In your connection string i see that you are using, "Initial
Catalog=QnsContract". I wonder if you connect to master instead and execute
sp_attach_db, allow it to finish, disconnect from master, and finally
connect to QnsContract. I wonder if that would work?

thx,


Brian

--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
"Pepe Taboada" <pepe.taboada (AT) verizon (DOT) net> wrote in message
news:463cee48$1 (AT) newsgroups (DOT) borland.com...
Quote:
Brian,
I mean I can't use, sp_attach_db, in my Win32 app. Since my customer is
local on the first day I attached the database manually and put this code
in
the Main's form create event:

if ADOConnection1.ConnectionString = '' then
begin
ConnecString := 'Provider=SQLOLEDB.1; Integrated Security=SSPI; Persist
Security Info=False; Initial Catalog=QnsContract; Data
Source=.\SQLEXPRESS';
ADOConnection1.ConnectionString := PromptDataSource(Handle,
ConnecString);
ADOConnection1.Connected := True;
end;//if ADOConnection1.ConnectionString = '' then

As you can imagine this would no be convinient if my customer were across
the country. I remembering reading somewhere in Microsoft's web site
something that said you can only use "sp_attach_db" on .NET apps.
If you have any solutions to my problem on suggestion I would greatly
appreciated
Thanks
Pepe

Back to top
Carlos Fandango
Guest





PostPosted: Tue May 08, 2007 12:13 am    Post subject: Re: Deploying SQL Express? Reply with quote

sp_attach_db has no restrictions by connection type. However your initial
catalog must be valid, so if QnsContract is the db you want to attach it can
not be your initial catalog, try master, model or msdb.

-Euan
"Pepe Taboada" <pepe.taboada (AT) verizon (DOT) net> wrote in message
news:463cee48$1 (AT) newsgroups (DOT) borland.com...
Quote:
Brian,
I mean I can't use, sp_attach_db, in my Win32 app. Since my customer is
local on the first day I attached the database manually and put this code
in the Main's form create event:

if ADOConnection1.ConnectionString = '' then
begin
ConnecString := 'Provider=SQLOLEDB.1; Integrated Security=SSPI; Persist
Security Info=False; Initial Catalog=QnsContract; Data
Source=.\SQLEXPRESS';
ADOConnection1.ConnectionString := PromptDataSource(Handle,
ConnecString);
ADOConnection1.Connected := True;
end;//if ADOConnection1.ConnectionString = '' then

As you can imagine this would no be convinient if my customer were across
the country. I remembering reading somewhere in Microsoft's web site
something that said you can only use "sp_attach_db" on .NET apps.
If you have any solutions to my problem on suggestion I would greatly
appreciated
Thanks
Pepe
Back to top
Pepe T
Guest





PostPosted: Tue May 08, 2007 8:11 am    Post subject: Re: Deploying SQL Express? Reply with quote

Brian, Carlos,
my code works as is. Maybe I wasn't clear. I want to deploy my app and my
database files with a simple copy command; and make a connection to my
database automatically without the customer having to attach it manually
using SQL Server Management Studio.
Remenber my ADOQueries and ADOConnection are hardcoded in my app.
When I give my customer the related tables I manually attach the database in
Management Studio but I want to avoid this step and do it within my code.
Thanks
Pepe
PD. Any suggestion will be appreciated.
Back to top
Bill Todd
Guest





PostPosted: Wed May 09, 2007 1:28 am    Post subject: Re: Deploying SQL Express? Reply with quote

Both Brian and Carlos have told you how to attach the database from
code.

1) Connect to the master database.
2) Call the sp_attach_db stored procedure.

Have you tried this? If you have a problem with these two steps let us
know.

--
Bill Todd (TeamB)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.