New topic: 

Empty Value of TEXT-Datatype-Field in Recordset of M$-SQL-DB

<http://forums.realsoftware.com/viewtopic.php?t=24927>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       jraess           Post subject: Empty Value of TEXT-Datatype-Field 
in Recordset of M$-SQL-DBPosted: Thu Oct 23, 2008 10:25 am                      
  
Joined: Mon Jan 22, 2007 9:47 am
Posts: 55              I'm connecting to an existing Database on a 
M$-SQL-Server using ODBC. (RB 2008r3.1 / 2008r4.1 / Current ODBC-Plugin 
downloaded from RS-Website)
More or less everything works just fine, but something seems quite strange. I'm 
having difficulty with the Field-Datatypes TEXT and VARCHAR(MAX).

An example: There is a Table 'TestTable' with an autoincremented INTEGER-Field, 
some VARCHAR(20/200/1000)-Field, a VARCHAR(MAX)-Field, a TEXT-Field, ...

When I get a RecordSet like this: "SELECT * FROM TestTable" and try to access 
the TEXT-Field (named: 'Remarks'): rs.Field("Remarks").StringValue
=> I get nothing (but there is some text stored in the DB)

When I get a RecordSet like this: "SELECT Remarks FROM TestTable" and try to 
access the TEXT-Field (named: 'Remarks'): rs.Field("Remarks").StringValue
=> I get the text

When I get a RecordSet like this: "SELECT *, Remarks AS MyRemarks FROM 
TestTable" and try to access the TEXT-Field (named: 'Remarks'): 
rs.Field("Remarks").StringValue / rs.Field("MyRemarks").StringValue
=> Remarks: I get nothing (but there is some text stored in the DB)
=> MyRemarks: I get the text

Why does the "SELECT *" return empty values in the RecordSet (for Fields with 
DataType 'TEXT'), but explicitly selecting the Field with it's name doesn't 
(and shows the text that is stored on the DB)?
Am I doing something wrong - or how do others access TEXT-Fields of a 
M$-SQL-Server using ODBC? I really hope the solution/workaround is not to 
explicitly selecting all fields in every SQL-Query...?   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     

-- 
Over 900 classes with 18000 functions in one REALbasic plug-in. 
The Monkeybread Software Realbasic Plugin v8.1. 

&lt;http://www.monkeybreadsoftware.de/realbasic/plugins.shtml&gt;

[email protected]

Reply via email to