Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / October 2005



Tip: Looking for answers? Try searching our database.

Using DESC in SELECT Statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
-jeff - 28 Oct 2005 21:48 GMT
I am trying to retrieve a field "DESC" from a table in a DB.

If I send my Select statement is "SELECT * FROM Table" I get a bunch
of fields that I don't want. If I use "SELECT DESC FROM Table", my vb
program shows an error in the statement while trying to open the
recordset. I've tracked this down to DESC being a keyword. I am
actually interested in getting ten of the 100+ fields in the table but
it won't let me use the field name "DESC" in the select statement.

Since I can't change the name of the field I am reading from, is there
any workaround?

There may be a well known way to pass a keyword as a field name but
I've not been able to find the answer.

Thanks.

-jeff
Ralph - 28 Oct 2005 23:15 GMT
> I am trying to retrieve a field "DESC" from a table in a DB.
>
[quoted text clipped - 14 lines]
>
> -jeff

Depends on your database. There are 'escape' delimiters.

You might be able to do something as simple as ...
 SELECT [DESC] FROM <table>

-ralph
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.