|
 |
asp_databases thread: RE: Strange problem with cast table from movie.mdb
Message #1 by "CLINTON PARSLEY" <cparsley@m...> on Wed, 15 May 2002 07:42:49 -0700
|
|
Until you can change the name of the table you can wrap the name of the
table inside of [ ] and that should do the trick for you.
eg [CAST]
----Original Message Follows----
From: "Ken Schaefer" <ken@a...>
Reply-To: "ASP Databases" <asp_databases@p...>
To: "ASP Databases" <asp_databases@p...>
Subject: [asp_databases] RE: Strange problem with cast table from movie.mdb
Date: Wed, 15 May 2002 16:03:29 +1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Cecil Westerhoff" <DecebalComputing@x...>
Subject: [asp_databases] RE: Strange problem with cast table from movie.mdb
: Op dinsdag 14 mei 2002 19:33, schreef u:
: > CAST is a reserved word in SQL.... is not a good name for a table.
: >
: > try change table name
:
: How could I do this? I do not have Access only the database. It is a
database
: belonging to the code of 'Beginning ASP 3.0'. I wonder how they got it in?
:
: Where could I find a list of the reserved words?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To work efficiently with an MSDE database you really need to get the SQL
Server Client Tools. I suggest you download the SQL Server trial edition (or
get it on CD somehow), and install the SQL Server client tools. You can use
Enterprise Manager, or Query Analyser to alter the database.
Alternatively, you can use ADO to send T-SQL statements to the database, but
that's a pain to debug when you write the statements incorrectly.
You can get a list of reserved words from SQL Server's Books Online - which
you can download (or they also come as part of the SQL Server Client tools).
Download is here:
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Cheers
Ken
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 15 May 2002 16:03:29 +1000
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Cecil Westerhoff" <DecebalComputing@x...>
Subject: [asp_databases] RE: Strange problem with cast table from movie.mdb
: Op dinsdag 14 mei 2002 19:33, schreef u:
: > CAST is a reserved word in SQL.... is not a good name for a table.
: >
: > try change table name
:
: How could I do this? I do not have Access only the database. It is a
database
: belonging to the code of 'Beginning ASP 3.0'. I wonder how they got it in?
:
: Where could I find a list of the reserved words?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To work efficiently with an MSDE database you really need to get the SQL
Server Client Tools. I suggest you download the SQL Server trial edition (or
get it on CD somehow), and install the SQL Server client tools. You can use
Enterprise Manager, or Query Analyser to alter the database.
Alternatively, you can use ADO to send T-SQL statements to the database, but
that's a pain to debug when you write the statements incorrectly.
You can get a list of reserved words from SQL Server's Books Online - which
you can download (or they also come as part of the SQL Server Client tools).
Download is here:
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Cheers
Ken
Message #3 by Cecil Westerhoff <DecebalComputing@x...> on Tue, 14 May 2002 20:46:56 +0200
|
|
Op dinsdag 14 mei 2002 19:33, schreef u:
> CAST is a reserved word in SQL.... is not a good name for a table.
>
> try change table name
How could I do this? I do not have Access only the database. It is a database
belonging to the code of 'Beginning ASP 3.0'. I wonder how they got it in?
Where could I find a list of the reserved words?
Message #4 by "Giovanni Salucci" <g.salucci@n...> on Tue, 14 May 2002 19:33:15 +0200
|
|
CAST is a reserved word in SQL.... is not a good name for a table.
try change table name
> Op maandag 13 mei 2002 14:18, schreef u:
> > Please supply the code for the cast table access
Message #5 by Cecil Westerhoff <DecebalComputing@x...> on Tue, 14 May 2002 19:17:56 +0200
|
|
Op maandag 13 mei 2002 14:18, schreef u:
> Please supply the code for the cast table access
I have two files. In the first I select the existing tables:
<%
Option Explicit
Dim strConnect
%>
<!-- #include file = "datastore.asp" -->
<!-- #include virtual ="/Include/adovbs.inc" -->
<HTML>
<HEAD>
<TITLE>Displaying all the tables</TITLE>
</HEAD>
<BODY>
<form action = "TableInfo.asp" method = "post">
<select name = "Table">
<%
Dim NewLine, objConn, objRS, Table
NewLine = chr(13)
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
Set objRS = objConn.OpenSchema(adSchemaTables, _
Array(Empty, Empty, Empty, "Table"))
While Not objRS.EOF
Table = objRS("TABLE_NAME")
Response.Write("<option value = """ & Table & """>" & Table & NewLine)
objRS.MoveNext
Wend
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
</select><br>
<input type = "checkbox" name = "DisplayFields">Toon Inhoud<br>
<input type = "submit" value = "Toon tabel">
</form>
</BODY>
</HTML>
One of those tables is selected and the name is send to the second file:
<%
Option Explicit
Dim strConnect
%>
<!-- #include file = "datastore.asp" -->
<!-- #include virtual ="/Include/adovbs.inc" -->
<HTML>
<HEAD>
<TITLE>Displaying all the tables</TITLE>
</HEAD>
<BODY>
<form action = "TableInfo.asp" method = "post">
<select name = "Table">
<%
Dim NewLine, objConn, objRS, Table
NewLine = chr(13)
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
Set objRS = objConn.OpenSchema(adSchemaTables, _
Array(Empty, Empty, Empty, "Table"))
While Not objRS.EOF
Table = objRS("TABLE_NAME")
Response.Write("<option value = """ & Table & """>" & Table & NewLine)
objRS.MoveNext
Wend
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
</select><br>
<input type = "checkbox" name = "DisplayFields">Toon Inhoud<br>
<input type = "submit" value = "Toon tabel">
</form>
</BODY>
</HTML>
As far as I can see there is nothing wrong with the code. And it works fine
for all other tables. There is only a problem with the table cast.
If anyone understands what is happening, I would glad to hear about it.
Message #6 by "Drew, Ron" <RDrew@B...> on Mon, 13 May 2002 08:18:46 -0400
|
|
Please supply the code for the cast table access
-----Original Message-----
From: Cecil Westerhoff [mailto:cwesterh@w...]
Sent: Sunday, May 12, 2002 5:39 PM
To: ASP Databases
Subject: [asp_databases] Strange problem with cast table from movie.mdb
I have the following code:
Set objConn =3D Server.CreateObject("ADODB.Connection")
objConn.Open(strConnect)
Set objRS =3D Server.CreateObject("ADODB.Recordset")
objRS.Open Table, strConnect
With all tables in the movie database this works fine, except with the
cast table. With this table I get:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
'SELECT', or 'UPDATE'.
/BegASP/TableInfo.asp, line 37
Anybody an idea what could be happening here?
Message #7 by Cecil Westerhoff <DecebalComputing@x...> on Mon, 13 May 2002 10:30:45 +0200
|
|
I would suppose so. I use schemes to get all the table names. All the other
names I get work fine, only the name cast gives me this problem.
Op maandag 13 mei 2002 08:42, schreef u:
> <%
> ' Is the name of the table "cast"?
>
> strTable = "Cast"
>
> Set objConn = Server.CreateObject("ADODB.Connection")
> objConn.Open(strConnect)
>
> Set objRS = Server.CreateObject("ADODB.Recordset")
> objRS.Open Table, objConn
> %>
>
> Cheers
> Ken
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: "Cecil Westerhoff" <cwesterh@w...>
> Subject: [asp_databases] Strange problem with cast table from movie.mdb
>
> : I have the following code:
> : Set objConn = Server.CreateObject("ADODB.Connection")
> : objConn.Open(strConnect)
> : Set objRS = Server.CreateObject("ADODB.Recordset")
> : objRS.Open Table, strConnect
> :
> : With all tables in the movie database this works fine, except with the
>
> cast table. With this table I get:
> : Error Type:
> : Microsoft JET Database Engine (0x80040E14)
> : Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
> : 'SELECT', or 'UPDATE'.
> : /BegASP/TableInfo.asp, line 37
> :
> : Anybody an idea what could be happening here?
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
Message #8 by "Ken Schaefer" <ken@a...> on Mon, 13 May 2002 16:42:04 +1000
|
|
<%
' Is the name of the table "cast"?
strTable = "Cast"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(strConnect)
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open Table, objConn
%>
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Cecil Westerhoff" <cwesterh@w...>
Subject: [asp_databases] Strange problem with cast table from movie.mdb
: I have the following code:
: Set objConn = Server.CreateObject("ADODB.Connection")
: objConn.Open(strConnect)
: Set objRS = Server.CreateObject("ADODB.Recordset")
: objRS.Open Table, strConnect
:
: With all tables in the movie database this works fine, except with the
cast table. With this table I get:
: Error Type:
: Microsoft JET Database Engine (0x80040E14)
: Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
: 'SELECT', or 'UPDATE'.
: /BegASP/TableInfo.asp, line 37
:
: Anybody an idea what could be happening here?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #9 by "Cecil Westerhoff" <cwesterh@w...> on Sun, 12 May 2002 21:38:58
|
|
I have the following code:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(strConnect)
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open Table, strConnect
With all tables in the movie database this works fine, except with the cast table. With this table I get:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
'SELECT', or 'UPDATE'.
/BegASP/TableInfo.asp, line 37
Anybody an idea what could be happening here?
|
|
 |