Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 empty record fields

Author  Topic 

hmuench
Starting Member

1 Post

Posted - 2004-07-20 : 09:57:53
Hello,

I have this simple code fragment ('dbcon' is valid adodb.connection):
<%
sSelectK = "SELECT tbl_sms_Keyword.DF_sIntro_de AS sIntro, tbl_sms_Provider.DF_bSubscriptionType, tbl_sms_Keyword.PK_Keyword, tbl_sms_Keyword.DF_bAsSubscriptionAvailable, tbl_sms_Keyword.DF_bKeywordType, tbl_sms_Keyword.DF_fDefaultPrice, tbl_sms_Keyword.DF_sKeyword_de AS sKeyword, tbl_sms_Keyword.DF_fSubDefPrice, tbl_sms_Keyword.DF_bActive FROM tbl_sms_Keyword INNER JOIN tbl_sms_SubTheme2Provider ON tbl_sms_Keyword.FK_SubTheme2ProviderID = tbl_sms_SubTheme2Provider.PK_SubTheme2ProviderID INNER JOIN tbl_sms_Provider ON tbl_sms_SubTheme2Provider.FK_ProviderID = tbl_sms_Provider.PK_ProviderID WHERE (tbl_sms_SubTheme2Provider.PK_SubTheme2ProviderID = foo)"

set rsK = dbcon.execute(sSelectK)

if not rsK.EOF then
do
response.write rsK("sIntro") & "<br>"
rsK.MoveNext
if rsK.EOF then exit do
loop
end if
%>

The problem is, that rsK("sIntro") returns "" even in the database is a finite string in the coresponding record field 'DF_sIntro_de'. The other fields are yielding correct results.

If I split the SELECT string into two parts, one without searching the record field 'DF_sIntro_de' and another where only the field 'DF_sIntro_de' is searched, I get correct results.

I should mention, that the string in this record filed is a bit longer (one phrase long) and that the data field on the MS SQL database is defined as 'text'.

I have this workaround, but it is ugly and annoying, since I have to loop through rsK and have to retrieve the corresponding values for 'DF_sIntro_de' of a second recordset object rsK2....

Does anybody has an idea why rs("sIntro") returns an empty string?

Regards

Hagen
   

- Advertisement -