dcsimg
Results 1 to 5 of 5

Thread: ASP-DBPro/MagicCell/Bits

  1. #1
    Steve Guest

    ASP-DBPro/MagicCell/Bits

    Saw a similar post, but the link to the solution doesn't seem to work.

    I'm trying to use MagicCell to either show an image or not, depending on whether a BIT datatype from MS SQL Server is True or False.

    I can't seem to get it to work.

    Any ideas?

  2. #2
    John Guest

    ASP-DBPro/MagicCell/Bits (reply)


    Hi Steve,

    First, which link is not working. Next, need more info. Let us know what version you're using, and show us your dbSQL and dbMagicCell statements that are not working. That will help us suggest a solution.

    Thanks,
    John


    ------------
    Steve at 3/22/01 3:56:11 PM

    Saw a similar post, but the link to the solution doesn't seem to work.

    I'm trying to use MagicCell to either show an image or not, depending on whether a BIT datatype from MS SQL Server is True or False.

    I can't seem to get it to work.

    Any ideas?

  3. #3
    Steve Guest

    ASP-DBPro/MagicCell/Bits (reply)

    My apologies.

    The link that is given as the solution is example 19 at "http://www.aspdb.com/V2". However, I get a "Page not found" error when I try to open this page. So, I can't see example 19.

    I'm using ASP-dbPro, The Version says "ASPDB - 6.UNO.09.07-EX-DL-EUA.

    Here's what I'm trying:

    SQL Server database column is IMG (a Bit type, true=image exists, false=image does not exist).

    MagicCell script:

    X.dbMagicCell = &#34;IMG,,(#IMG#|EQ|True||<img src=&#34;&#34;/imagaes.image.gif&#34;&#34;>~|EL|||#IMG#)&#34;




    ------------
    John at 3/22/01 4:17:35 PM


    Hi Steve,

    First, which link is not working. Next, need more info. Let us know what version you&#39;re using, and show us your dbSQL and dbMagicCell statements that are not working. That will help us suggest a solution.

    Thanks,
    John


    ------------
    Steve at 3/22/01 3:56:11 PM

    Saw a similar post, but the link to the solution doesn&#39;t seem to work.

    I&#39;m trying to use MagicCell to either show an image or not, depending on whether a BIT datatype from MS SQL Server is True or False.

    I can&#39;t seem to get it to work.

    Any ideas?

  4. #4
    Guest

    ASP-DBPro/MagicCell/Bits (reply)

    I now see the problem. You can&#39;t do a MagicCell on a boolean. You need to create a dummy field and convert it to numeric (1 or 0).

    The following worked:

    &#39; Select the Img boolean field and create a dummy field in the SQL
    SQL = (SELECT Img, Img*1 AS Dummy FROM Database)

    &#39; Hide the Original Field and Show only the Dummy
    x.GridHideFlds = &#34;Img&#34;

    &#39; Set the MagicCell
    &#39; image.gif is the image to display
    &#39; noimage.gif is a transparent gif
    x.MagicCell = &#34;Dummy,,(#Dummy#|EQ|True||<img src=&#34;&#34;image.gif&#34;&#34;>~|EL|||<img src=&#34;&#34;noimage.gif&#34;&#34;>)&#34;


    Steve




    ------------
    Steve at 3/22/01 3:56:11 PM

    Saw a similar post, but the link to the solution doesn&#39;t seem to work.

    I&#39;m trying to use MagicCell to either show an image or not, depending on whether a BIT datatype from MS SQL Server is True or False.

    I can&#39;t seem to get it to work.

    Any ideas?

  5. #5
    Frank Kwong Guest

    ASP-DBPro/MagicCell/Bits (reply)

    MagicCell supports (4) datat types - String, Numeric, Date and Boolean, you have to use -> EQB to compare to Boolean. See the doc....

    EQ?, GT?, LT?.... The &#34;?&#34; is the Type (S,N,D or B) S=default.


    FK


    ------------
    at 3/22/01 6:49:59 PM

    I now see the problem. You can&#39;t do a MagicCell on a boolean. You need to create a dummy field and convert it to numeric (1 or 0).

    The following worked:

    &#39; Select the Img boolean field and create a dummy field in the SQL
    SQL = (SELECT Img, Img*1 AS Dummy FROM Database)

    &#39; Hide the Original Field and Show only the Dummy
    x.GridHideFlds = &#34;Img&#34;

    &#39; Set the MagicCell
    &#39; image.gif is the image to display
    &#39; noimage.gif is a transparent gif
    x.MagicCell = &#34;Dummy,,(#Dummy#|EQ|True||<img src=&#34;&#34;image.gif&#34;&#34;>~|EL|||<img src=&#34;&#34;noimage.gif&#34;&#34;>)&#34;


    Steve




    ------------
    Steve at 3/22/01 3:56:11 PM

    Saw a similar post, but the link to the solution doesn&#39;t seem to work.

    I&#39;m trying to use MagicCell to either show an image or not, depending on whether a BIT datatype from MS SQL Server is True or False.

    I can&#39;t seem to get it to work.

    Any ideas?

Posting Permissions

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