Board index » delphi » D4/MS SQL oddity -- any clues?

D4/MS SQL oddity -- any clues?

Hi all,
  I have an MS SQL-7 table (Usage) with 3 fields (ACCOUNT, FILES, MB)
using 'SELECT * FROM Usage' in MS Query analyzer shows the three
fields and the rows in the Usage table.  Using the same SQL statement
in a TQuery connecting to the same table will show only the FILES and
MB fields and their data.  If the TQuery SQL is 'SELECT ACCOUNT from
Usage'  I get a blank column header with lots of blank rows.  A join
using another table on the ACCOUNT field will work, returning the
matching rows, but still no ACCOUNT column.  I'm using Delphi4 C/S
with update pack3 installed.  Any clues?
Thanks,
Myron
--------------------------------------------------------------------------
C. Myron Ware   Senior Prog/Analyst, CNE
http://www.geocities.com/Colosseum/1370/
 

Re:D4/MS SQL oddity -- any clues?


  As with most things, the solution was a simple one once it was
found.  The table in question stated that the ACCOUNT field was an
nvarchar.  In another table that joins this one, the ACCOUNT field is
simply a varchar.  I changed the  Data Type to varchar and Delphi
could see the column and all was right in the world.  I saved a trace
from the ODBC SQL log if you guys would like to take a look.  It shows
that 3 columns were recognized and returns their names, then it begins
returning info for only two.  Is the nvarchar a non-supported data
type for the BDE?  It was also odd that the join between the tables
worked, even though the fieldbyname on the nvarchar wouldn't.  These
are things that make you go 'Hmmmm...'
Myron

sun...@rotfl.com (C. Myron Ware) wrote:

Quote
>Hi all,
>  I have an MS SQL-7 table (Usage) with 3 fields (ACCOUNT, FILES, MB)
>using 'SELECT * FROM Usage' in MS Query analyzer shows the three
>fields and the rows in the Usage table.  Using the same SQL statement
>in a TQuery connecting to the same table will show only the FILES and
>MB fields and their data.  If the TQuery SQL is 'SELECT ACCOUNT from
>Usage'  I get a blank column header with lots of blank rows.  A join
>using another table on the ACCOUNT field will work, returning the
>matching rows, but still no ACCOUNT column.  I'm using Delphi4 C/S
>with update pack3 installed.  Any clues?

--------------------------------------------------------------------------
C. Myron Ware   Senior Prog/Analyst, CNE
http://www.geocities.com/Colosseum/1370/

Other Threads