database query problem

H

Holstein

I am setting up a database results page in FP 2002. I
created my access database and I can view a table just
fine in my browser. I wrote a query that works in Access
but when I try to view it in my browser I get the
following error:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver]
Too few parameters. Expected 1.
Number: -2147217904 (0x80040E10)
Source: Microsoft OLE DB Provider for ODBC Drivers

The query is this:
SELECT [Employee Master].[Last Name], [Test Master].[Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master].[Employee
Number]
WHERE [Employee Master].[Last Name]=[enter name];

In Access this query lets me enter a name and view the
test score for the person. I'm sorry for the long post
but I wanted to provide as much info as possible. Any
help is always appreciated. Thanks in advance.
 
K

Kevin Spencer

In Access you can type in the name, but in an ASP page, you can't. You have
to BUILD the query string with the value from the form concatenated in.
Example:

SELECT [Employee Master].[Last Name], [Test Master].[Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master].[Employee
Number]
WHERE [Employee Master].[Last Name] = '::YourFormFieldName::'

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.
 
H

Holstein

I'm not sure that I understand this. I am not using a
form. I am using a results page to display information
from an access database that I populated. I did not
collect data from a form to populate it. I'm not sure
that I'm explaining this correctly. Any other help would
be appreciated.
-----Original Message-----
In Access you can type in the name, but in an ASP page, you can't. You have
to BUILD the query string with the value from the form concatenated in.
Example:

SELECT [Employee Master].[Last Name], [Test Master].[Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master].[Employee
Number]
WHERE [Employee Master].[Last Name] = '::YourFormFieldName::'

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

Holstein said:
I am setting up a database results page in FP 2002. I
created my access database and I can view a table just
fine in my browser. I wrote a query that works in Access
but when I try to view it in my browser I get the
following error:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver]
Too few parameters. Expected 1.
Number: -2147217904 (0x80040E10)
Source: Microsoft OLE DB Provider for ODBC Drivers

The query is this:
SELECT [Employee Master].[Last Name], [Test Master]. [Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master].[Employee
Number]
WHERE [Employee Master].[Last Name]=[enter name];

In Access this query lets me enter a name and view the
test score for the person. I'm sorry for the long post
but I wanted to provide as much info as possible. Any
help is always appreciated. Thanks in advance.


.
 
T

Thomas A. Rowe

Where is the value for =[enter name] come from?

It either has to be provide from a form, or a query string or hard coded in
the query.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


Holstein said:
I'm not sure that I understand this. I am not using a
form. I am using a results page to display information
from an access database that I populated. I did not
collect data from a form to populate it. I'm not sure
that I'm explaining this correctly. Any other help would
be appreciated.
-----Original Message-----
In Access you can type in the name, but in an ASP page, you can't. You have
to BUILD the query string with the value from the form concatenated in.
Example:

SELECT [Employee Master].[Last Name], [Test Master].[Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master].[Employee
Number]
WHERE [Employee Master].[Last Name] = '::YourFormFieldName::'

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

Holstein said:
I am setting up a database results page in FP 2002. I
created my access database and I can view a table just
fine in my browser. I wrote a query that works in Access
but when I try to view it in my browser I get the
following error:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver]
Too few parameters. Expected 1.
Number: -2147217904 (0x80040E10)
Source: Microsoft OLE DB Provider for ODBC Drivers

The query is this:
SELECT [Employee Master].[Last Name], [Test Master]. [Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master].[Employee
Number]
WHERE [Employee Master].[Last Name]=[enter name];

In Access this query lets me enter a name and view the
test score for the person. I'm sorry for the long post
but I wanted to provide as much info as possible. Any
help is always appreciated. Thanks in advance.


.
 
G

grw

If you wish to return ALL records, leave off the where clause.

WHERE [Employee Master].[Last Name]=[enter name];



Holstein said:
I'm not sure that I understand this. I am not using a
form. I am using a results page to display information
from an access database that I populated. I did not
collect data from a form to populate it. I'm not sure
that I'm explaining this correctly. Any other help would
be appreciated.
-----Original Message-----
In Access you can type in the name, but in an ASP page, you can't. You have
to BUILD the query string with the value from the form concatenated in.
Example:

SELECT [Employee Master].[Last Name], [Test Master].[Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master].[Employee
Number]
WHERE [Employee Master].[Last Name] = '::YourFormFieldName::'

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

Holstein said:
I am setting up a database results page in FP 2002. I
created my access database and I can view a table just
fine in my browser. I wrote a query that works in Access
but when I try to view it in my browser I get the
following error:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver]
Too few parameters. Expected 1.
Number: -2147217904 (0x80040E10)
Source: Microsoft OLE DB Provider for ODBC Drivers

The query is this:
SELECT [Employee Master].[Last Name], [Test Master]. [Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master].[Employee
Number]
WHERE [Employee Master].[Last Name]=[enter name];

In Access this query lets me enter a name and view the
test score for the person. I'm sorry for the long post
but I wanted to provide as much info as possible. Any
help is always appreciated. Thanks in advance.


.
 
H

Holstein

I added the [enter name] so when I run the query an input
box comes up and I can enter the name that I want to view
records for. If I take this out I am able to view all
records. Is there another way I could set this up?
-----Original Message-----
If you wish to return ALL records, leave off the where clause.

WHERE [Employee Master].[Last Name]=[enter name];



Holstein said:
I'm not sure that I understand this. I am not using a
form. I am using a results page to display information
from an access database that I populated. I did not
collect data from a form to populate it. I'm not sure
that I'm explaining this correctly. Any other help would
be appreciated.
-----Original Message-----
In Access you can type in the name, but in an ASP
page,
you can't. You have
to BUILD the query string with the value from the form concatenated in.
Example:

SELECT [Employee Master].[Last Name], [Test Master]. [Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master].[Employee
Number]
WHERE [Employee Master].[Last Name] = '::YourFormFieldName::'

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

I am setting up a database results page in FP 2002. I
created my access database and I can view a table just
fine in my browser. I wrote a query that works in Access
but when I try to view it in my browser I get the
following error:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver]
Too few parameters. Expected 1.
Number: -2147217904 (0x80040E10)
Source: Microsoft OLE DB Provider for ODBC Drivers

The query is this:
SELECT [Employee Master].[Last Name], [Test Master]. [Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master]. [Employee
Number]
WHERE [Employee Master].[Last Name]=[enter name];

In Access this query lets me enter a name and view the
test score for the person. I'm sorry for the long post
but I wanted to provide as much info as possible. Any
help is always appreciated. Thanks in advance.





.


.
 
H

Holstein

Thanks to everyone for their help. I was able to get it
working the way I wanted it to. I took off the [enter
name] in the query and added a search box to the results
page by specifying which criteria I wanted. Once again,
thanks to everyone for their help.
-----Original Message-----
I added the [enter name] so when I run the query an input
box comes up and I can enter the name that I want to view
records for. If I take this out I am able to view all
records. Is there another way I could set this up?
-----Original Message-----
If you wish to return ALL records, leave off the where clause.

WHERE [Employee Master].[Last Name]=[enter name];



Holstein said:
I'm not sure that I understand this. I am not using a
form. I am using a results page to display information
from an access database that I populated. I did not
collect data from a form to populate it. I'm not sure
that I'm explaining this correctly. Any other help would
be appreciated.
-----Original Message-----
In Access you can type in the name, but in an ASP page,
you can't. You have
to BUILD the query string with the value from the form
concatenated in.
Example:

SELECT [Employee Master].[Last Name], [Test Master]. [Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master]. [Employee
Number]
WHERE [Employee Master].[Last Name]
= '::YourFormFieldName::'

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

I am setting up a database results page in FP
2002.
I
created my access database and I can view a table just
fine in my browser. I wrote a query that works in
Access
but when I try to view it in my browser I get the
following error:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver]
Too few parameters. Expected 1.
Number: -2147217904 (0x80040E10)
Source: Microsoft OLE DB Provider for ODBC Drivers

The query is this:
SELECT [Employee Master].[Last Name], [Test Master].
[Test
Section], [Test Master].Score
FROM [Employee Master] INNER JOIN [Test Master] ON
[Employee Master].[Employee #]=[Test Master]. [Employee
Number]
WHERE [Employee Master].[Last Name]=[enter name];

In Access this query lets me enter a name and view the
test score for the person. I'm sorry for the long post
but I wanted to provide as much info as possible. Any
help is always appreciated. Thanks in advance.





.


.
.
 

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