navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Database Results Step 2 Problem

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Database Results Step 2 Problem
Page: [1]
 
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
Database Results Step 2 Problem - 8/15/2005 21:40:28   
I am trying to select a table to display from a database that contains many tables. I am using a drop down list in a form to make my selection. In my html on the form page, I have added onchange=form1.submit() and pointed the form to my database results page. In step 2 of the database wizzard, I choose the Custom Query and put Select * from ::FormFieldName::, but I can't get it to Verify. ?????????
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/15/2005 21:55:08   
Make a default table view using one table - then use the Spooky diet to modify the code afterwards?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
RE: Database Results Step 2 Problem - 8/15/2005 22:05:14   
I guess I'm to new to know what your diet method is but I created the database results to show one table and then returned to the database results properties and changed the table name to my form field name and I keep getting the same error below.

Server error: Unable to retrieve schema information from the query:

SELECT * FROM 1

against a database using the connection string

DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=Build/OHSMaster.mdb.

The following error message comes from the database driver software; it may appear in a different language depending on how the driver is configured.

Do you think that I'm not getting the form field passed?

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/15/2005 22:39:19   
It sounds like you are using a reserved word for a table name? what should the "1" be normally?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
RE: Database Results Step 2 Problem - 8/15/2005 22:58:18   
My tables are all named as years. Example 1959, 1960, etc. and my form field name is classyear. I am only displaying names from the table. I don't have any problems if I combine all the tables but the database is so large when I do that it gets real slow and there are several people that are adding data to each year and it would be better if they was seperate tables. Thanks for any help you might give me.

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/15/2005 23:20:52   
Use "SELECT * FROM [tablename]"

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
RE: Database Results Step 2 Problem - 8/15/2005 23:32:08   
Same answer if I use [tablename] or [classyear] . I'm thinking that it's something to simple to see.

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/15/2005 23:44:13   
Is there more to the SQL string you are trying? What is the name of the database (not the table)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 17:46:08   
I am using FP2002. The database name is OHSMaster.mdb and I renamed the tables to OHS1954, OHS1955, OHS1956, etc. and still have the same problem. I am using a dropdown box in my form. The form page is below.

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<form method="POST" action="test2.asp" name="form1">
  <p><select size="1" name="classyear" onchange=form1.submit()>
  <option value="OHS1941">1941</option>
  <option value="OHS1944">1944</option>
  <option value="OHS1945">1945</option>
  <option value="OHS1946">1946</option>
  <option value="OHS1947">1947</option>
  </select></p>
</form>

</body>

</html>


The database is on test2.asp and will display a table if I specify the table name directly. But gives me this error if I try to use the form field name. Should I have anything on the database page pointing to the page that the form is on. Error is below.

Server error: Unable to retrieve schema information from the query:

SELECT * FROM 1

against a database using the connection string

DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/OHSMaster.mdb.

The following error message comes from the database driver software; it may appear in a different language depending on how the driver is configured.
-------------------------------------------------------
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query '1'. Make sure it exists and that its name is spelled correctly.

Source: Microsoft OLE DB Provider for ODBC Drivers
Number: -2147467259 (0x80004005)

Below is test2.asp, the database page.

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<table border="1">
  <thead>
    <tr>
      <td><b>School_Name</b></td>
    </tr>
  </thead>
  <tbody>
    <!--webbot bot="DatabaseRegionStart" s-columnnames="School_Name,Full_Name,Street,City,State,Zip,Email,Phone,Web_Site,Birth_Date,Picture1,Picture2,Picture3,Picture4" s-columntypes="202,202,202,202,202,202,202,202,202,202,202,202,202,202" s-dataconnection="OHSM" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="FALSE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE" s-recordsource="OHS1978" s-displaycolumns="School_Name" s-criteria s-order="[School_Name] +" s-sql="SELECT * FROM OHS1978 ORDER BY School_Name ASC" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound i-maxrecords="0" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the start of a Database Results region.</font></td></tr>" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM OHS1978 ORDER BY School_Name ASC"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=1 align=left width=""100%""></td></tr>"
fp_sDataConn="OHSM"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&School_Name=202&Full_Name=202&Street=202&City=202&State=202&Zip=202&Email=202&Phone=202&Web_Site=202&Birth_Date=202&Picture1=202&Picture2=202&Picture3=202&Picture4=202&"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="45452" --><tr>
      <td>
      <!--webbot bot="DatabaseResultColumn" s-columnnames="School_Name,Full_Name,Street,City,State,Zip,Email,Phone,Web_Site,Birth_Date,Picture1,Picture2,Picture3,Picture4" s-column="School_Name" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>School_Name<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"School_Name")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="28556" --></td>
    </tr>
    <!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
</table>
<p> </p>

</body>

</html>

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 17:48:32   
When you try to use the form field name, how are you changing the SQL string?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 17:59:21   
I have used several.
Select * from '::classyear::'
Select * from ::classyear::
Select * from 'classyear'
Select * from classyear
SELECT * FROM [::classyear::]
Select * from classyear

Wich would be the correct method? Is a table name considered text?

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 18:04:11   
The second one could work, however I would recomend using the spooky diet and then change it to asp

Select * from "&Request.Form("classyear")

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 18:07:02   
It didn't come up with a 1 anyway, but tis is what it came up with.

Server error: Unable to retrieve schema information from the query:

Select * from "&Request.Form("classyear")

against a database using the connection string

DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/OHSMaster.mdb.

The following error message comes from the database driver software; it may appear in a different language depending on how the driver is configured.
-------------------------------------------------------
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.

Source: Microsoft OLE DB Provider for ODBC Drivers
Number: -2147217900 (0x80040e14)

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 18:15:07   
Where did you change that? what does the full code look like?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 18:20:26   
I changed it in step 2 of the dbw. I also tried
Select * from "&Request.Form1("classyear") as the form is named form1

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 18:26:49   
No, you need to do that manually after applying the Spooky diet.
Once youve done the diet, you cant use the wizard.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 18:55:07   
Here is what I tried. I don't know if I got it correct as the page wouldn't display.



<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<table border="1">
<thead>
<tr>
<td><b>School_Name</b></td>
</tr>
</thead>
<tbody>
<!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT School_Name FROM "&Request.Form1("classyear") ORDER BY School_Name ASC"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=1 align=left width=""100%""></td></tr>"
fp_sDataConn="OHSM"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&School_Name=202&Full_Name=202&Street=202&City=202&State=202&Zip=202&Email=202&Phone=202&Web_Site=202&Birth_Date=202&Picture1=202&Picture2=202&Picture3=202&Picture4=202&"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
</tbody>
</body>

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/16/2005 21:08:23   
One small change :

 fp_sQry="SELECT School_Name FROM "&Request.Form("classyear") &" ORDER BY School_Name ASC" 


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
bass__man

 

Posts: 10
Joined: 8/15/2005
Status: offline

 
RE: Database Results Step 2 Problem - 8/18/2005 17:53:16   
Still doesn't work. I'm at a total loss. I guess I will check with my ISP.

(in reply to Spooky)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Database Results Step 2 Problem - 8/18/2005 21:42:55   
Whats the last peice of code you tried and what does "not work" mean?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to bass__man)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Database Results Step 2 Problem
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts