BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange "unspecified error" in D7/Access query

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Glenn Alcott
Guest





PostPosted: Wed Oct 18, 2006 8:12 pm    Post subject: Strange "unspecified error" in D7/Access query Reply with quote



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





PostPosted: Wed Oct 18, 2006 8:52 pm    Post subject: Re: Strange "unspecified error" in D7/Access query Reply with quote



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





PostPosted: Wed Oct 18, 2006 9:04 pm    Post subject: Re: Strange "unspecified error" in D7/Access query Reply with quote



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





PostPosted: Wed Oct 18, 2006 9:29 pm    Post subject: Re: Strange "unspecified error" in D7/Access query Reply with quote

"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





PostPosted: Thu Oct 19, 2006 8:11 am    Post subject: Re: Strange "unspecified error" in D7/Access query Reply with quote

"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? Smile
Back to top
CC
Guest





PostPosted: Thu Oct 19, 2006 10:23 pm    Post subject: Re: Strange "unspecified error" in D7/Access query Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.