Data won't appear out of Text field from SQL

Results 1 to 3 of 3

Thread: Data won't appear out of Text field from SQL

  1. #1
    Join Date
    Dec 1969

    Default Data won't appear out of Text field from SQL

    I&#039;m trying to access data from a field of type "text" in asp. The code looks like this:<BR><BR>sql = "SELECT Units FROM User_Reports WHERE PK=8773"<BR>Set rs = conn.Execute(sql)<BR><BR>Response.Write rs("Units")<BR><BR><BR>Nothing comes up. I have not had trouble accessing any other fields that are of the "text" type in other tables. And I run the same SQL statement in Query Analyzer and there IS data in that field. Anyone have any suggestions? It seems like I&#039;ve heard issues with the "text" data type before.<BR><BR>Jenk

  2. #2
    Join Date
    Dec 1969

    Default show the actual code

    not what it looks like.<BR><BR>That will show the actual error.<BR><BR>Also before doing the response.write, do this...<BR><BR>response.write rs.eof<BR><BR>Check what values does it return. It will return FALSE if there are no rows returned.

  3. #3
    Join Date
    Dec 1969

    Default Put some quotes around it for debug

    try this:<BR>response.write("&#039;" & rs("Units") & "&#039;")<BR><BR>You said there is data in the field, but are there any records that violate your key, with the same keyvalue and no value in the database?<BR><BR>any other error checking?<BR><BR>remove any "on error resume next" commands, to see any and all actual errors.<BR><BR>-- Whol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts