| View previous topic :: View next topic |
| Author |
Message |
Glenn Alcott Guest
|
Posted: Wed Oct 18, 2006 8:12 pm Post subject: Strange "unspecified error" in D7/Access query |
|
|
I have a D7 app with an MS Access database, using ADO. In one of the tables
is a text field called Position, and in the app I run the following query
using a TADOQuery object:
select sum(profit) from trades where position="long"
This query results in an "Unspecified error" message (which is an OLE error)
when opened, and so does every other query referring to the Position field.
All other queries run without any problem. I suspected that for some reason
the field name was a problem, and when I changed it to TradePosition
everything was fine.
I wonder if anyone knows why that field name would cause a problem.
Glenn |
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Wed Oct 18, 2006 8:52 pm Post subject: Re: Strange "unspecified error" in D7/Access query |
|
|
Glenn Alcott wrote:
| Quote: | I wonder if anyone knows why that field name would cause a problem.
|
All SQL dialects have words that are reserved for special meanings. In
ANSI standard SQL you can still use a reserved word as the name of a
table or column but you must enclose the name in double quotes in a SQL
statement.
--
Bill Todd (TeamB) |
|
| Back to top |
|
 |
Vitali Kalinin Guest
|
Posted: Wed Oct 18, 2006 9:04 pm Post subject: Re: Strange "unspecified error" in D7/Access query |
|
|
| Quote: | I wonder if anyone knows why that field name would cause a problem.
This happens since Access treats Position as a reserved word, thus you need |
to quote it like this [Position]. |
|
| Back to top |
|
 |
Glenn Alcott Guest
|
Posted: Wed Oct 18, 2006 9:29 pm Post subject: Re: Strange "unspecified error" in D7/Access query |
|
|
"Vitali Kalinin" <vitkalinin (AT) yahoo (DOT) com> wrote in message
news:453650a6 (AT) newsgroups (DOT) borland.com...
| Quote: |
I wonder if anyone knows why that field name would cause a problem.
This happens since Access treats Position as a reserved word, thus you
need
to quote it like this [Position].
|
I quoted it and that solved the problem. But I can't find any indication in
the Access documentation that Position is a reserved word, and the query
works in Access itself without any quotes. Kind of strange. And why can't
the error message be more informative than "unspecified error"? |
|
| Back to top |
|
 |
Vitali Kalinin Guest
|
Posted: Thu Oct 19, 2006 8:11 am Post subject: Re: Strange "unspecified error" in D7/Access query |
|
|
"Glenn Alcott" <galcott (AT) compuserve (DOT) com> сообщил/сообщила в новостях
следующее: news:45365659$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Vitali Kalinin" <vitkalinin (AT) yahoo (DOT) com> wrote in message
news:453650a6 (AT) newsgroups (DOT) borland.com...
I wonder if anyone knows why that field name would cause a problem.
This happens since Access treats Position as a reserved word, thus you
need
to quote it like this [Position].
I quoted it and that solved the problem. But I can't find any indication
in
the Access documentation that Position is a reserved word, and the query
works in Access itself without any quotes. Kind of strange. And why can't
the error message be more informative than "unspecified error"?
Who knows baby, who knows?  |
|
|
| Back to top |
|
 |
CC Guest
|
Posted: Thu Oct 19, 2006 10:23 pm Post subject: Re: Strange "unspecified error" in D7/Access query |
|
|
On Wed, 18 Oct 2006 12:29:18 -0400, "Glenn Alcott"
<galcott (AT) compuserve (DOT) com> wrote:
| Quote: | "Vitali Kalinin" <vitkalinin (AT) yahoo (DOT) com> wrote in message
news:453650a6 (AT) newsgroups (DOT) borland.com...
And why can't
the error message be more informative than "unspecified error"?
|
Welcome to the wonderful world of microsoft! |
|
| Back to top |
|
 |
|