Stupidly named field selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to work with and IBM AS400 OLE DB data provider and when using
the wizard, I am going along selecting my fields and setting a WHERE clause.
There is a field with a "#" at the end of it. As soon as I type this WHERE
clause, I have an error message about the syntax and I know that it has to do
with the "#". I have enclosed the field name with quotes, single quotes and
nothing seems to work.

I have been using the ODBC which does work fine, however I am a beginner at
ASP .Net (I usually do Windows apps) and I have a problem with pulling data
from the AS400 using ODBC.

Help, what can I do?

Brad
 
You have two fixes, a bandaid approach and permanent solution. The bandaid
however may be the only viable option - so it really depends on your
internal situation. By delimmiting your column names in [columnName#] you
should be able to fix the problem. HOwever, you're going to forget about
this with some other query - or some other programmer is going to forget
about it in the future and you'll have to spend time tracking down the
problem only to learn what's already known. If at all possible, rename the
column. If not, then do the []. Both are Correct in every sense, it's just
that one solves this particular problem and the other addresses the root
cause. [God, I sound like some International Affairs expert on CNN].
 
Back
Top