Solved

db engine cannot find the input table or query

Posted on 2007-03-28
12
353 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

759 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now