Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS Access
 Weird Error??
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

avyworld
Starting Member

USA
48 Posts

Posted - 01 April 2001 :  17:43:30  Show Profile  Send avyworld an AOL message
I am trying to connect to my database that holds articles. Everything should work, but for some reason my SQL query does gets this error:

quote:

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 'properties'. Make sure it exists and that its name is spelled correctly.

/dbtestings/search/by-author.asp, line 18



The weirdest part is that I have an "Add an Article" page that works, and I copied the table name from that. Could someone please help? The code is below.


<%@ language="vbscript" %>
<%

dim author

author = Request.QueryString("author")

dim oConn
dim sSQL
dim oRS


Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\dbtestings\db\articles.mdb")

sSQL = "SELECT * FROM properties WHERE author='" & author & "'"

Set oRS = oConn.Execute(sSQL)

%>

<html>
<head>
<title>Articles Written by <%=author%></title>
<style type="text/css">
.header {font-size:14pt}
</style>
</head>
<body bgcolor="#FFFFFF">
<div class="header">Articles Written By <%=author%></div>

<%

Do While NOT oRS.EOF

%>

<p><a href="../read-article.asp?title=<%=oRS("title").Value%>"><%=oRS("title").Value%></a>

<% Loop %>

</body>
</html>

<% oRS.MoveNext %>


HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 01 April 2001 :  19:10:10  Show Profile  Visit HuwR's Homepage
my first thought would be that properties is a reserved word, so you should rename your table to something else.

Go to Top of Page

avyworld
Starting Member

USA
48 Posts

Posted - 01 April 2001 :  20:20:52  Show Profile  Send avyworld an AOL message
Well, then why did it work in the other one? Also, how do you rename a table (using SQL)?

Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 01 April 2001 :  20:41:13  Show Profile
Try putting [ ] around the table name. This syntax will work with SQL Server and Access.


======
Doug G
======
Go to Top of Page

avyworld
Starting Member

USA
48 Posts

Posted - 01 April 2001 :  20:54:26  Show Profile  Send avyworld an AOL message
How do I rename the table in SQL, though?

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 01 April 2001 :  21:42:37  Show Profile  Visit HuwR's Homepage
For access, I think you would need to use some ado commands, since you can't rename a table using SQL, on SQL server you can execute a stored procedure.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07