|
 |
asp_databases thread: how to invoke an Access form's button on-click event from ASP
Message #1 by "GARY ROUTH" <gary.routh2@v...> on Wed, 26 Feb 2003 09:49:12 -0600
|
|
Greetings,
My Access db performs it's main reason for existence (builds a pedigree) by using scripts and functions called by the on-click event
of a button on a form. The user selects a name from the list and clicks the button. The event looks up the parents of the name and
adds them to the list and iteratively adds the grand-parents, etc for several generations and writes the results to a temporary
table.
Is it possible to invoke the onclick event of the button on the form from ASP? And if so, what is the ASP syntax to do this?
Specific code chunks:
Having the user select the name from the list is ASP -
<!-- #include file="Connect.inc" -->
<%
'Check for database errors
Call CheckForErrors(objConn)
'Create the recordset object, set the SQL string and open the recordset
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT horses.ID, horses.Name, horses.Registry, Horses.RegNo FROM horses ORDER BY horses.Name;", "DSN=SOF"
objRS.movefirst
%>
<FORM METHOD="get" ACTION ="PedListHorses1.asp">
<P><SELECT NAME="lstNames" SIZE="1">
<%
%>
<OPTION
VALUE="<%=objRS("ID")%>"><%=objRS("Name")%> - <%=objRS("Registry")%> <%=objRS("Re
gNo")%></OPTION>
<%
Do While NOT objRS.EOF
objRS.MoveNext
Loop
objRS.Close
Set objRS=nothing
%>
The form name is HorseSearch, the button name is btnDisplayPedigree.
Any help is GREATLY appreciated! Many thanks.
Gary
Message #2 by "Ken Schaefer" <ken@a...> on Thu, 27 Feb 2003 11:37:59 +1100
|
|
You can't do this directly from ASP using ADO. Why? ADO using the Jet OLEDB
Provider which connects to the Jet Engine (the database engine underneath
Access). Access is just the GUI that sits ontop of Jet.
The only way that I can think of for doing this would be to instantiate an
Access object in your ASP page, open the database, then the form, then click
the button. Not sure how well this would work (eg blocking web users etc).
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "GARY ROUTH" <gary.routh2@v...>
Subject: [asp_databases] how to invoke an Access form's button on-click
event from ASP
: Greetings,
: My Access db performs it's main reason for existence (builds a pedigree)
by using scripts and functions called by the on-click event of a button on a
form. The user selects a name from the list and clicks the button. The
event looks up the parents of the name and adds them to the list and
iteratively adds the grand-parents, etc for several generations and writes
the results to a temporary table.
:
: Is it possible to invoke the onclick event of the button on the form from
ASP? And if so, what is the ASP syntax to do this?
: Specific code chunks:
: Having the user select the name from the list is ASP -
: <!-- #include file="Connect.inc" -->
: <%
: 'Check for database errors
: Call CheckForErrors(objConn)
: 'Create the recordset object, set the SQL string and open the recordset
: Set objRS = Server.CreateObject("ADODB.Recordset")
: objRS.Open "SELECT horses.ID, horses.Name, horses.Registry, Horses.RegNo
FROM horses ORDER BY horses.Name;", "DSN=SOF"
: objRS.movefirst
: %>
: <FORM METHOD="get" ACTION ="PedListHorses1.asp">
: <P><SELECT NAME="lstNames" SIZE="1">
: <%
: %>
:
: <OPTION
VALUE="<%=objRS("ID")%>"><%=objRS("Name")%> - <%=objRS("Registry")
%> <%=objRS("RegNo")%></OPTION>
: <%
: Do While NOT objRS.EOF
: objRS.MoveNext
: Loop
: objRS.Close
: Set objRS=nothing
: %>
:
: The form name is HorseSearch, the button name is btnDisplayPedigree.
:
: Any help is GREATLY appreciated! Many thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #3 by gary.routh2@v... on Thu, 27 Feb 2003 01:43:31
|
|
Ken,
Since this is an iterative process, would the correct approach then be to
make several requests to the database using ASP to built this temp table?
Thanks,
Gary
> You can't do this directly from ASP using ADO. Why? ADO using the Jet
OLEDB
Provider which connects to the Jet Engine (the database engine underneath
Access). Access is just the GUI that sits ontop of Jet.
The only way that I can think of for doing this would be to instantiate an
Access object in your ASP page, open the database, then the form, then
click
the button. Not sure how well this would work (eg blocking web users etc).
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "GARY ROUTH" <gary.routh2@v...>
Subject: [asp_databases] how to invoke an Access form's button on-click
event from ASP
: Greetings,
: My Access db performs it's main reason for existence (builds a pedigree)
by using scripts and functions called by the on-click event of a button on
a
form. The user selects a name from the list and clicks the button. The
event looks up the parents of the name and adds them to the list and
iteratively adds the grand-parents, etc for several generations and writes
the results to a temporary table.
:
: Is it possible to invoke the onclick event of the button on the form from
ASP? And if so, what is the ASP syntax to do this?
: Specific code chunks:
: Having the user select the name from the list is ASP -
: <!-- #include file="Connect.inc" -->
: <%
: 'Check for database errors
: Call CheckForErrors(objConn)
: 'Create the recordset object, set the SQL string and open the recordset
: Set objRS = Server.CreateObject("ADODB.Recordset")
: objRS.Open "SELECT horses.ID, horses.Name, horses.Registry, Horses.RegNo
FROM horses ORDER BY horses.Name;", "DSN=SOF"
: objRS.movefirst
: %>
: <FORM METHOD="get" ACTION ="PedListHorses1.asp">
: <P><SELECT NAME="lstNames" SIZE="1">
: <%
: %>
:
: <OPTION
VALUE="<%=objRS("ID")%>"><%=objRS("Name")%> - <%=objRS
("Registry")
%> <%=objRS("RegNo")%></OPTION>
: <%
: Do While NOT objRS.EOF
: objRS.MoveNext
: Loop
: objRS.Close
: Set objRS=nothing
: %>
:
: The form name is HorseSearch, the button name is btnDisplayPedigree.
:
: Any help is GREATLY appreciated! Many thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #4 by "Ken Schaefer" <ken@a...> on Thu, 27 Feb 2003 14:51:27 +1100
|
|
Hmm, I'm not sure what you can do using just Jet SQL. There's an SQL list at
p2p.wrox.com which you might want to subscribe to where you might be able to
get an SQL only suggestion. Otherwise, you may be stuck with the (relatively
unscalable) solution of multiple SQL statements.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <gary.routh2@v...>
Subject: [asp_databases] Re: how to invoke an Access form's button on-click
event from ASP
: Ken,
: Since this is an iterative process, would the correct approach then be to
: make several requests to the database using ASP to built this temp table?
: Thanks,
: Gary
: > You can't do this directly from ASP using ADO. Why? ADO using the Jet
: OLEDB
: Provider which connects to the Jet Engine (the database engine underneath
: Access). Access is just the GUI that sits ontop of Jet.
:
: The only way that I can think of for doing this would be to instantiate an
: Access object in your ASP page, open the database, then the form, then
: click
: the button. Not sure how well this would work (eg blocking web users etc).
:
: Cheers
: Ken
|
|
 |