Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Host that allows stopping web service from Control Panel


Message #1 by "Michael Drucker" <mhdrucker@m...> on Tue, 19 Nov 2002 22:25:54
I have a client that changes their Access database Table entries daily. 
Then then FTP to their current host. Yje host then stops the web service 
so no users are on their web site, replaces the old database with the new 
one, then restarts the web service. They would like to do this themselves. 
Does anyone know of a web hosting company that has this feature on their 
Control Panel?

Mike Drucker
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 20 Nov 2002 11:10:36 +1100
The host stop the Web Publishing Service? That would stop *all* websites on
the machine. If this guy has the only website on the machine, then I'd ask
the host for administrative privelages. You can stop and start services from
a batch file using net stop and net start, so that'd be all you need.

On the other hand, if you mean "the host stops the website", then no service
is being stopped, just the website in question. If so, it may be possible to
give your user "Admin this website" permissions in the IIS MMC Snapin. That
might allow you client (via the MMC Snapin) to stop and start his/her own
website.

Lastly, one possible way to get around all of this, without stopping or
starting anything, is to have two .mdb files. Only one of which is being
used at any one time. In addition, you have an include file (or an
application variable) that points to the correct database file. When a new
database is uploaded, the *unused* file is over-written and the include
file/application variable is also updated to put to the second file. The
first file can then be removed.

Your include file could look like this:

<%
Function GetDBConnString( _
    )

    GetDBConnString = "Provider=Microsoft.Jet.OLEBD.4.0;"

    If Application("CurrentDatabase") = 1 then
        GetDBConnString = GetDBConnString & "Data Source=c:\first.mdb"
    Else
        GetDBConnString = GetDBConnString & "Data Source=c:\second.mdb"
    End If

End Function
%>

and your main page would look like:

<%
Option Explicit
%>
<!-- #include virtual="/inc/GetDBConnString.asp" -->
<%
'
'
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open GetDBConnString()
%>

You would have an "admin" page, that let you "switch" the application
variable's value from 1 to 2 (eg via a form). You would probably also want
to put something into Application_OnStart() in the global.asa file that will
look (eg using the FSO) to see which file exists, and set the application
variable appropriately.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Michael Drucker" <mhdrucker@m...>
Subject: [access_asp] Host that allows stopping web service from Control
Panel


: I have a client that changes their Access database Table entries daily.
: Then then FTP to their current host. Yje host then stops the web service
: so no users are on their web site, replaces the old database with the new
: one, then restarts the web service. They would like to do this themselves.
: Does anyone know of a web hosting company that has this feature on their
: Control Panel?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index