Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Unhappy Unanswered: Populating radio buttons - Access vs. MSSQL

    Have recently migrated an Access database to MSSQL.

    The following code worked in Access but fails in MSSQL

    <input <%If (CStr(Recordset1.Fields.Item("Disclose").Value) = CStr("TRUE")) Then Response.Write("CHECKED") : Response.Write("")%> type="radio" name="Disclose" value="1">

    <input <%If (CStr((Recordset1.Fields.Item("Disclose").Value)) = CStr("FALSE")) Then Response.Write("CHECKED") : Response.Write("")%> name="Disclose" type="radio" value="0" >

    In Query Analyzer, when I run SELECT Disclose from TABLE, it returns the number 1.

    On an ASP page, when I run Response.Write(Recordset1.Fields.Item("Disclose"). Value) it returns TRUE.

    Have tried changing the = CStr("TRUE") portion to = 1 but it fails to work either way.

    Any ideas?

  2. #2
    Join Date
    Feb 2004
    One Flump in One Place
    What is the datatype of the field? Bit?

    Assuming so, below should be fine (no need to convert both sides to strings:
    Recordset1.Fields.Item("Disclose").Value = 1
    If you still struggle I will move this to the ASP forum as it is not a SQL Server issue.

Posting Permissions

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