Help! Help! ASP Form

H

hrider1

I've a form that request data from a remote SQL sever when a user enters a
starting date and a ending date on the form. I am not sure why but when the
form opens I get the following error:

Database Results Wizard Error
Description: [Microsoft][ODBC SQL Server Driver]Invalid use of default
parameter
Number: -2147467259 (0x80004005)
Source: Microsoft OLE DB Provider for ODBC Drivers

One or more form fields were empty. You should provide default values for
all form fields that are used in the query.

But the Form works, how can I fixs this problem??

Jim
 
P

p c

I prefer Kathleen's suggestion. It is simpler to debug and keep it clean
when you separate the form form the processing page.

You are using a combined page that is includes the form that gets
submitted and also proceses the the form results. If you want to stay
with a single page, you need to provide default dates or logic (code) to
not submit the form if either of the date fields are empty.

...PC
 
S

Stefan B Rusynko

You don't need to add defaults (or use multiple pages)
All you need to do is wrap the DBRW in a conditional statement that will prevent it from running until you have a value from the
form

In code view

.... your query form is here
(with say the form field name is "Search")

<% IF Len(Request.Form("Search") > 0 THEN %>

....DBRW goes here

<% End IF %>
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I prefer Kathleen's suggestion. It is simpler to debug and keep it clean
| when you separate the form form the processing page.
|
| You are using a combined page that is includes the form that gets
| submitted and also proceses the the form results. If you want to stay
| with a single page, you need to provide default dates or logic (code) to
| not submit the form if either of the date fields are empty.
|
| ..PC
|
| Kathleen Anderson [MVP - FrontPage] wrote:
| > You could split it up, so the search form is on one page and the results are
| > on another:
| > http://www.spiderwebwoman.com/resources/dbrwtipsandtricks.asp#return
| >
 
P

p c

I agree, Stefan. Thanks for clarifcation.

Isn't a conditional statement "code that prevents submision of the form"?

...PC
 
S

Stefan B Rusynko

Conditional Statement is anything you want it to be

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I agree, Stefan. Thanks for clarifcation.
|
| Isn't a conditional statement "code that prevents submision of the form"?
|
| ..PC
|
| Stefan B Rusynko wrote:
| > You don't need to add defaults (or use multiple pages)
| > All you need to do is wrap the DBRW in a conditional statement that will prevent it from running until you have a value from the
| > form
| >
| > In code view
| >
| > ... your query form is here
| > (with say the form field name is "Search")
| >
| > <% IF Len(Request.Form("Search") > 0 THEN %>
| >
| > ...DBRW goes here
| >
| > <% End IF %>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top