Hi Bob
oUpload, is a part of ASPUpload, which is what my predecessor used to upload
a Word doc to our webserver.
I dont think i explained qu1 too well: I wish to execute the function in
access and then release the ASP page from access. Then the server can busy
itself running the code, which only modifies data in the background and the
user can continue looking through the website.
I dont fancy turning the code into VBScript as it will take much longer to
run.
Thanks Si
"Bob Barrows" <> wrote in message
news:%...
> Si wrote:
> > Hi Guys
> >
> > I am using this code to execute an Access VBA function from ASP:
> >
> > strDbName = strDataSource & "data\webjobs.mdb"
> > Set objAccess = Server.CreateObject("Access.Application")
> > objAccess.Visible = False
> > objAccess.OpenCurrentDatabase strDbName
> > objAccess.Run "ASP_SkillSearch", strTable, oUpload.Form("firstname"),
> > oUpload.Form("surname")
>
> What is oUpload?
>
> >
> > I have a few issues that i need to solve, any help would be greatly
> > appreciated:
> >
> > 1/ This code takes around 2+mins to run, so I would like the code to
> > run and for the webpage to be released immediately, so that they do
> > not have to wait for the code.
>
> Access does not support asynchronous execution, so it cannot be done this
> way. You should find another way to run this code. For one thing: it is
not
> a good idea to automate Access (or any Office app) from ASP code. There
will
> be no one sitting at the server to respond to errors.
>
> Is it possible to convert the VBA code to a vbscript function that can be
> run in an ASP page? If so, you can use the XMLHTTPRequest object from
> client-side code to asynchronously call the page. For details, please post
> to a client-side code newsgroup devoted to whichever language you are
using
> in your client-side code. Look for newsgroups with "dhtml" in their name.
> m.p.scripting.* will also do.
>
> If you need to do this in server-side code, you can use the ServerXMLHTTP
> object, like this:
>
> <%
> url = "RunSkillSearch.ASP"
> set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP")
> xmlhttp.open "GET", url, true
> xmlhttp.send ""
> set xmlhttp = nothing
> %>
>
> If you need to pass parameters do this instead:
> url = "RunSkillSearch.ASP?firstname=" & _
> oUpload.Form("firstname") & "&surname=" & _
> oUpload.Form("surname")
>
>
> >
> > 2/ I would like to do a similar thing that i do in VB6 (i am new to
> > ASP) which i would use this code for:
> > on error resume next
> > Set objAccess =
> > Server.GetObject("Access.Application") If err =
> > True then Set objAccess =
> > Server.CreateObject("Access.Application")
> > End if
> > Is it possible to check if a version of access is running, like above?
>
> Yes. On Error Resume Next works in vbscript.
>
> HTH,
> Bob Barrows
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
|