By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,856 Members | 2,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,856 IT Pros & Developers. It's quick & easy.

Store program EXE in table?

P: n/a
HC
Hello, Folks. I am not sure if this can be done (and a brief search of
this group didn't yield any results that I thought would do the trick)
but if it can be done it would make my life easier so here goes.

First, what I am trying to accomplish is to make a program I've written
automatically update itself if there is a newer version on the network.
Second, my application runs on one or more computers at many
geographically separated locations. I have remote control software
that enables me to remotely update and troubleshoot my application but
I since I have to pay for this access per computer I don't have the
ability to control each and every computer that runs my software (for
those clients with more than one computer that uses my software).

Third, my application uses as its data storage system MSDE 2000 (with
current service pack).

Fourth, my users are not technical people and I want to rely on them as
little as possible.

Fifth, not all of the workstations are Internet enabled or connected,
so having the application check a website for an update is not
feasible.

Finally, to bring those different pieces together, what I want to be
able to do is connect to and control the "server" (the computer with
MSDE installed on it) and store in the database what the current
version number is along with the current program files. Then, when the
application launches, it will check that stored version number against
it's own version number to determine if there is a newer version
available. If there is a newer version available I want it to update
itself (that workstation) by retrieving that newer software from the
database. I want to avoid file sharing because it's problematic and
since I already have SQL Server (MSDE) running on the network I'd like
to use that.

Is there some way that I can either a) store my program files (one EXE
approximately 5MB in size and one OCX approximately 250KB in size) in a
table to be retrieved by my application so it can update itself or b) a
way to get SQL Server (MSDE) to read a file locally on the server and
return it to my application just like it would any recordset so I could
just tell it where the file was and let it read it from whichever
folder it's stored in?

I've looked at making a column of datatype Binary, and perhaps that's
the way I'll go (re-creating the field to the correct size each time I
do an update or perhaps making it really big so I don't have to worry
about the size). But I thought I'd ask around first since this isn't
anything I know much about.

Thank you for your time and help.

--HC

Jun 8 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
HC wrote:
Hello, Folks. I am not sure if this can be done (and a brief search of
this group didn't yield any results that I thought would do the trick)
but if it can be done it would make my life easier so here goes.

First, what I am trying to accomplish is to make a program I've written
automatically update itself if there is a newer version on the network.
Second, my application runs on one or more computers at many
geographically separated locations. I have remote control software
that enables me to remotely update and troubleshoot my application but
I since I have to pay for this access per computer I don't have the
ability to control each and every computer that runs my software (for
those clients with more than one computer that uses my software).

Third, my application uses as its data storage system MSDE 2000 (with
current service pack).

Fourth, my users are not technical people and I want to rely on them as
little as possible.

Fifth, not all of the workstations are Internet enabled or connected,
so having the application check a website for an update is not
feasible.

Finally, to bring those different pieces together, what I want to be
able to do is connect to and control the "server" (the computer with
MSDE installed on it) and store in the database what the current
version number is along with the current program files. Then, when the
application launches, it will check that stored version number against
it's own version number to determine if there is a newer version
available. If there is a newer version available I want it to update
itself (that workstation) by retrieving that newer software from the
database. I want to avoid file sharing because it's problematic and
since I already have SQL Server (MSDE) running on the network I'd like
to use that.

Is there some way that I can either a) store my program files (one EXE
approximately 5MB in size and one OCX approximately 250KB in size) in a
table to be retrieved by my application so it can update itself or b) a
way to get SQL Server (MSDE) to read a file locally on the server and
return it to my application just like it would any recordset so I could
just tell it where the file was and let it read it from whichever
folder it's stored in?

I've looked at making a column of datatype Binary, and perhaps that's
the way I'll go (re-creating the field to the correct size each time I
do an update or perhaps making it really big so I don't have to worry
about the size). But I thought I'd ask around first since this isn't
anything I know much about.

Thank you for your time and help.

--HC


You could use IMAGE (SQL Server 2000) or VARBINARY(MAX) (SQL Server
2005).

Check out ClickOnce:
http://msdn.microsoft.com/netframewo...res/clickonce/

ClickOnce may be the solurtion for those that are online. For those
that aren't, I don't understand why you can't deploy the installer to a
file path and have the application execute it from there - seems like a
lot less trouble to me.

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/m...S,SQL.90).aspx
--

Jun 8 '06 #2

P: n/a
HC (hb*****@gte.net) writes:
Is there some way that I can either a) store my program files (one EXE
approximately 5MB in size and one OCX approximately 250KB in size) in a
table to be retrieved by my application so it can update itself or b) a
way to get SQL Server (MSDE) to read a file locally on the server and
return it to my application just like it would any recordset so I could
just tell it where the file was and let it read it from whichever
folder it's stored in?
No, SQL Server cannot (easily) read a file from the network and pass it on
the server. After all, SQL Server is a database server, not a file server.
I've looked at making a column of datatype Binary, and perhaps that's
the way I'll go (re-creating the field to the correct size each time I
do an update or perhaps making it really big so I don't have to worry
about the size). But I thought I'd ask around first since this isn't
anything I know much about.


You could have to use the image data type, as binary is restricted to
8000 bytes. The image data type is fairly kludgy to work with.

Overall, while this could be made working, this does not sound like a
good design to me. A solution that involves only the file system is a
lot better in the long run, although there appears to be some hassle
with it right now. Yet another alternative would be to write your own
server app that accepts a connection from the application, and sends
a binary in reply if there is a newer one.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 8 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.