MSSQL7 bit datatype

Results 1 to 3 of 3

Thread: MSSQL7 bit datatype

  1. #1
    jyts Guest

    Default MSSQL7 bit datatype

    Hi All<BR><BR>I have a problem that I&#039;ve been trying to solve for 3 days onend.<BR>I have a mssql7 db . In this db there is a table with a bit field (boolean)<BR>called adenable. I have inserted 2 records, one with the value 1 and the<BR>other 0.The field defaults to 0.<BR><BR>When I retrieve these records in a recordset, I am having trouble testing<BR>them.<BR><BR>I&#039;ve tried the following:<BR>if myrs("adenable")=1 then<BR>if myrs("adenable")="1" then<BR>if myrs("adenable")=true &#039;this test if a value exists at all<BR>&#039;I believe so because it returns true for both 1 and 0<BR>if myrs("adenable")="true"<BR>if myrs("adenable") then<BR>if myrs(2) then &#039; the numeric position in the recordset<BR><BR>In all of the case it returns the same for the 0 and 1 record.<BR><BR>When I do response.write(myrs("adenable")) it prints nothing.There must be<BR>something in the recordset as it evaluates true.<BR><BR>Please, I feel like head is exploding.<BR>Thanks<BR>Barry<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: MSSQL7 bit datatype

    Not sure try to convert: <BR>Response.write (cInt(myrs("adenable"))

  3. #3
    jyts Guest

    Default RE: MSSQL7 bit datatype

    I&#039;ve tried cint and cstr to no avail.<BR>Thanks for your input.

Posting Permissions

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