Solved

db engine cannot find the input table or query

Posted on 2007-03-28
12
382 Views
Last Modified: 2012-06-21
Hi,

I have this page that works fine
http://www.cadante.com/cadante_css/vini.asp

Then I need another similar page displaying other products, I proceeded like this:

copied the access table "Vino" to have a new table, which I named "Alimenti", then I changed some field names, then I copied the vini.asp page, and named it "distillati.asp" and changed the line calling the data
Select * FROM Vino ORDER BY TipoVino
to
Select * FROM Alimenti ORDER BY Alimento

I uploaded and when going to
http://www.cadante.com/cadante_css/distillati.asp
I get this:

Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'Alimenti'. Make sure it exists and that its name is spelled correctly.
/cadante_css/distillati.asp, line 9

What did I do wrong, and how to fix it?

Thank you
0
Comment
Question by:keneso
  • 6
  • 5
12 Comments
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 18807215
Is the table name 'Alimenti' exist in the database?
can u post the code part of distillati.asp?
0
 
LVL 7

Author Comment

by:keneso
ID: 18807234
Hmmm ... did you read thru the question? ;)

Yes the "alimenti" has been created, and does have few data in it

And the code in the distillati.asp is the one I also posted:

Select * FROM Alimenti ORDER BY Alimento
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 18807257
yeah...but more information is needed to troubleshoot...;)

check your database connectionstring, whether it is pointing to the right database.

posting the full code will save lot of time keneso :)
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 7

Author Comment

by:keneso
ID: 18807287
>>check your database connectionstring, whether it is pointing to the right database.

To check that I put the
Select * FROM Vino ORDER BY TipoVino

and it works fine, ie the page opens, and when I change it back to
Select * FROM Alimenti ORDER BY Alimento

it returns the error.

I also tried changing the table name in the db, but seems the only table working is the "Vino"
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 18807325
Just copy the below code and paste in the page distillati.asp somewhere before your 'select' query. It will listout the table names in the database. Paste the results here:

----------------------------------------------------------------------------------------------
Dim rstSchema, rstStructure
Const adSchemaTables = 20
Set rstSchema = dbobj.OpenSchema(adSchemaTables)
Do Until rstSchema.EOF
Response.Write "Table name: " & rstSchema("TABLE_NAME") & vbCr & "Table type: " & rstSchema("TABLE_TYPE") & vbCr & "<BR>"
response.write rstSchema("TABLE_SCHEMA")
rstSchema.MoveNext
Loop
ListTables = True
0
 
LVL 7

Author Comment

by:keneso
ID: 18807452
Thanks.

I did, and I get this error

============= ERROR

Microsoft VBScript runtime  error '800a01a8'
Object required: ''
/cadante_css/distillati.asp, line 10


Anyway here is the full code (including the one you posted) regarding the issue:

=========== CODE

<%
sConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../mdb-database/databasevini.mdb") & ";UID=;PWD="
Set Conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Conn.Open sConnString
Dim rstSchema, rstStructure
Const adSchemaTables = 20
Set rstSchema = dbobj.OpenSchema(adSchemaTables)
Do Until rstSchema.EOF
Response.Write "Table name: " & rstSchema("TABLE_NAME") & vbCr & "Table type: " & rstSchema("TABLE_TYPE") & vbCr & "<BR>"
response.write rstSchema("TABLE_SCHEMA")
rstSchema.MoveNext
Loop
ListTables = True
sSql = "select * from Alimenti ORDER BY Alimento"
rs.Open sSql, Conn
%>
0
 
LVL 16

Accepted Solution

by:
CWS (haripriya) earned 250 total points
ID: 18807499
oops...change 'dbobj' in my code to 'conn' like this: AND CHECK NOW.

<%
sConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../mdb-database/databasevini.mdb") & ";UID=;PWD="
Set Conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Conn.Open sConnString
Dim rstSchema, rstStructure
Const adSchemaTables = 20
Set rstSchema = Conn.OpenSchema(adSchemaTables)
Do Until rstSchema.EOF
Response.Write "Table name: " & rstSchema("TABLE_NAME") & vbCr & "Table type: " & rstSchema("TABLE_TYPE") & vbCr & "<BR>"
response.write rstSchema("TABLE_SCHEMA")
rstSchema.MoveNext
Loop
ListTables = True
sSql = "select * from Alimenti ORDER BY Alimento"
rs.Open sSql, Conn
%>
0
 
LVL 7

Author Comment

by:keneso
ID: 18807615
Thank you.

Looks like the problem is th db, as the copied table is not seen.

=========== RESULT

Table name: MSysAccessObjects Table type: SYSTEM TABLE
Table name: MSysACEs Table type: SYSTEM TABLE
Table name: MSysObjects Table type: SYSTEM TABLE
Table name: MSysQueries Table type: SYSTEM TABLE
Table name: MSysRelationships Table type: SYSTEM TABLE
Table name: Vino Table type: TABLE

Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'Alimenti'. Make sure it exists and that its name is spelled correctly.
/cadante_css/distillati.asp, line 18
0
 
LVL 3

Expert Comment

by:VAScott
ID: 18807687
Try looking at the "last updated" date of the access DB on the server.  I think with access, if there's open connections to the DB when you try to upload it, it won't let you.
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 18807922
thanks ;)
0
 
LVL 7

Author Comment

by:keneso
ID: 18808308
>>VAScott

Sorry I missed to reply, the date and time are ok, I also redownloaded the db to make sure, as that was one of the first thing that came to my mind.
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 18813729
keneso, is the page working now? did u upload the db again?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error viewing ASP page 12 173
Element alignment and word wrapping 9 75
Error in query expression 3 48
Grunt Copy file to another destination. 1 56
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question