Display form and read the database from the same page

Display form and read the database from the same page

am 28.09.2005 13:50:22 von karenmiddleol

Hello All

I want to display a form with the following three fields:

CustomerID
ShipCity
ShipCountry

with a Execute button. Once the Execute button is pressed I want in the
same ASP page to query the local SQL Server Northwind database Orders
table and display the matching records from the following query like :

Select * from Orders where CustomerId = FormFieldCustomerId or
ShipCity = FormfieldShipCity or
ShipCountry = FormfieldShipCountry

Can somebody please share the ASP page code whereby in one page I can
get the formfields validate the form fields and execute the query and
display the results in the form of a HTML table all in the same page. I
do not want to have a HTML form field and a ASP page called from the
HTML page I want all to be in one page.

Thanks in advance
Karen

Re: Display form and read the database from the same page

am 28.09.2005 22:19:14 von unknown




your first view of page here...


<%

Dim sFormFieldCustomerId, sFormfieldShipCity, sFormfieldShipCountry
sFormFieldCustomerId = Request.Form("FormFieldCustomerId")
sFormfieldShipCity = Request.Form("FormfieldShipCity")
sFormfieldShipCountry = Request.Form("FormfieldShipCountry")

If sFormFieldCustomerId & sFormfieldShipCity & sFormfieldShipCountry <> ""
Then
''your code to execute that query here and get recordset
%>

<%
''close and destroy objects
End If
%>



Ray at work



wrote in message
news:1127908221.983418.34070@z14g2000cwz.googlegroups.com...
> Hello All
>
> I want to display a form with the following three fields:
>
> CustomerID
> ShipCity
> ShipCountry
>
> with a Execute button. Once the Execute button is pressed I want in the
> same ASP page to query the local SQL Server Northwind database Orders
> table and display the matching records from the following query like :
>
> Select * from Orders where CustomerId = FormFieldCustomerId or
> ShipCity = FormfieldShipCity or
> ShipCountry = FormfieldShipCountry
>
> Can somebody please share the ASP page code whereby in one page I can
> get the formfields validate the form fields and execute the query and
> display the results in the form of a HTML table all in the same page. I
> do not want to have a HTML form field and a ASP page called from the
> HTML page I want all to be in one page.
>
> Thanks in advance
> Karen
>

Re: Display form and read the database from the same page

am 30.09.2005 00:18:08 von SteveB

Perhaps this may hopefully give you some ideas:

Classic ASP Design Tips - Search Criteria on Multiple Fields
http://www.bullschmidt.com/devtip-searchcriteria.asp

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample

*** Sent via Developersdex http://www.developersdex.com ***

Re: Display form and read the database from the same page

am 05.10.2005 08:18:28 von SteveB

And this:

Classic ASP Design Tips - Post Back Page
http://www.bullschmidt.com/devtip-postbackpage.asp

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample

*** Sent via Developersdex http://www.developersdex.com ***