Database Error

D

Don E

I'm using FP 2002 and I am having troble with the Database Results. I have
several tables in my database with each having the name of a year. Example
(1998) How can I use a Form field to select which table to display the
results? I have tried Select * from ::fieldname:: and I get an error.and
the query end up being Select * from 1
 
T

Thomas A. Rowe

A better approach is to have a single table for all of the records, and have a field in the table
for the year (the field can not be actually named year, as it is a reserve word), then you can
retrieve data from a single table by year, etc.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
J

Jim Buyens

Where did the "1" come from?

Is it possible you have a drop-down list configured along the lines of:

<select size="1" name="fieldname">
<option value="1">2001</option>
<option value="2">2002</option>
<option value="3">2003</option>
</select>

If so, you need to put the full year numbers (table names) in the value=
attributes.

I must observe, however, that this sort of approach is hardly recommended
practice. You should really combine all the yearly tables into one and then
select the year you want.

Jim Buyens
Microsoft MVP
http://www.interlacken.com
Author of:
*-----------------------------­-----------------------
|\----------------------------­-----------------------
|| Microsoft Windows SharePoint Services Inside Out
|| Microsoft Office FrontPage 2003 Inside Out
||----------------------------­-----------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/----------------------------­-----------------------
*-----------------------------­-----------------------
 
S

Stefan B Rusynko

The 1 is generated by FP any time you try to use the DBRW to select a table (in Select * from ...)

TBMK
The FP DBRW can not use a conditional table name because it is totally dependent on the webot generated field info from a
predetermine table




| Where did the "1" come from?
|
| Is it possible you have a drop-down list configured along the lines of:
|
| <select size="1" name="fieldname">
| <option value="1">2001</option>
| <option value="2">2002</option>
| <option value="3">2003</option>
| </select>
|
| If so, you need to put the full year numbers (table names) in the value=
| attributes.
|
| I must observe, however, that this sort of approach is hardly recommended
| practice. You should really combine all the yearly tables into one and then
| select the year you want.
|
| Jim Buyens
| Microsoft MVP
| http://www.interlacken.com
| Author of:
| *-----------------------------­-----------------------
||\----------------------------­-----------------------
||| Microsoft Windows SharePoint Services Inside Out
||| Microsoft Office FrontPage 2003 Inside Out
|||----------------------------­-----------------------
||| Web Database Development Step by Step .NET Edition
||| Microsoft FrontPage Version 2002 Inside Out
||| Faster Smarter Beginning Programming
||| (All from Microsoft Press)
||/----------------------------­-----------------------
| *-----------------------------­-----------------------
|
| "Don E" wrote:
|
| > I'm using FP 2002 and I am having troble with the Database Results. I have
| > several tables in my database with each having the name of a year. Example
| > (1998) How can I use a Form field to select which table to display the
| > results? I have tried Select * from ::fieldname:: and I get an error.and
| > the query end up being Select * from 1
| >
| >
| >
| >
 
N

novus

Don E said:
I'm using FP 2002 and I am having troble with the Database Results. I have
several tables in my database with each having the name of a year.
Example (1998) How can I use a Form field to select which table to display
the results? I have tried Select * from ::fieldname:: and I get an
error.and the query end up being Select * from 1

I seem to remember that I had problems when I used tables or fields which
started with a digit. I started them with a letter and the problem went
away. That may have been due to my limited knowledge of SQL.

novus
 
P

p c

the * only works for selectieng all fields of a table. It does not work
for selecting all tables. Each Select satement must include the name of
the table. If you use table or field names that are reserved words or
include space in their name, you must enclose them in square brackets
for Access, or the delimeter acepted by your database.

E.g SELECT [field1], [fielde],.. FROM [tablename].

...PC
 
Top