Classic ASP, Trouble with fields.value

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Classic ASP, Trouble with fields.value

    running code like:

    for each ofield in rs.fields
    response.write ofield.value
    next

    Getting and error that says TYPE MISMATCH. I KNOW that value is a correct
    type, right???

    Using SQlserver

    --
    Joe Resudek
    Frontier New Media
    225 Crummer Lane
    Reno, NV 89509
    (775) 824-4040
    (775) 824-4044 fax
    [url]http://www.thefrontiergroup.com[/url]


    Joe Resudek Guest

  2. Similar Questions and Discussions

    1. .NET COM in Classic ASP
      I have created a simple .NET COM class. I have used regasm dllname.dll /tlb: dllname.tlb /codebase to register it on another server - the files...
    2. #26351 [Opn->Bgs]: Incorrect handling of Null Fields/Numerical Fields with '0'
      ID: 26351 Updated by: iliaa@php.net Reported By: jabberwocky at ibplanet dot com -Status: Open +Status: ...
    3. #26351 [NEW]: Incorrect handling of Null Fields/Numerical Fields with '0'
      From: jabberwocky at ibplanet dot com Operating system: Any PHP version: 4.3.4 PHP Bug Type: MSSQL related Bug description: ...
    4. MAC OS X NOT BETTER THAN CLASSIC!!
      OK, I have been using Mac OS X since version 10.0. Now, as a Mac user for more than 13 years, a UNIX/Linux user for more than 8 years, and as IT...
    5. VisualAge 6 installation trouble on aix 5.2, gcc trouble too :)
      I've installed gcc 3.x from UCLA site. and I got this error - In file included from test.c:23: /usr/include/pthread.h:554: error: parse error...
  3. #2

    Default Classic ASP, Trouble with fields.value

    I just copied your code into and asp page on my dev box,
    added the code for the connection objects and ran it. It
    works fine. There must be something you've left out.

    Exactly which line is failing?



    >-----Original Message-----
    >running code like:
    >
    >for each ofield in rs.fields
    > response.write ofield.value
    >next
    >
    >Getting and error that says TYPE MISMATCH. I KNOW that
    value is a correct
    >type, right???
    >
    >Using SQlserver
    >
    >--
    >Joe Resudek
    >Frontier New Media
    >225 Crummer Lane
    >Reno, NV 89509
    >(775) 824-4040
    >(775) 824-4044 fax
    >[url]http://www.thefrontiergroup.com[/url]
    >
    >
    >.
    >
    John Beschler Guest

  4. #3

    Default Re: Classic ASP, Trouble with fields.value

    "Joe Resudek" <joe@thefrontiergroup.com> wrote in message
    news:eAXB%23JTVDHA.3232@tk2msftngp13.phx.gbl...
    > running code like:
    >
    > for each ofield in rs.fields
    > response.write ofield.value
    > next
    >
    > Getting and error that says TYPE MISMATCH. I KNOW that value is a correct
    > type, right???
    >
    > Using SQlserver
    >
    > --
    > Joe Resudek
    > Frontier New Media
    > 225 Crummer Lane
    > Reno, NV 89509
    > (775) 824-4040
    > (775) 824-4044 fax
    > [url]http://www.thefrontiergroup.com[/url]
    >
    >
    On the assumption they are char fields, you might have some nulls,
    concatenating with an empty string will sort it.


    for each ofield in rs.fields
    response.write "" & ofield.value
    next

    If they are not char fields, test for null first.



    --
    John Blessing
    [url]http://www.LbeHelpdesk.com[/url] - Help Desk software at affordable prices
    [url]http://www.free-helpdesk.com[/url] - Completely free help desk software !
    [url]http://www.lbetoolbox.com[/url] - Remove Duplicates from MS Outlook
    [url]http://www.lbesync.com[/url] - Synchronize two Outlook Personal Folders

    John Blessing Guest

  5. #4

    Default Re: Classic ASP, Trouble with fields.value

    I will bet money that this is the issue, the first field is not a char
    field. I'll test it and change the code, thanks.


    --
    Joe Resudek
    Frontier New Media
    225 Crummer Lane
    Reno, NV 89509
    (775) 824-4040
    (775) 824-4044 fax
    [url]http://www.thefrontiergroup.com[/url]
    "John Blessing" <ntlnews@**REMOVETHIS**lbehelpdesk.com> wrote in message
    news:1zeVa.3865$G85.715@newsfep4-winn.server.ntli.net...
    > "Joe Resudek" <joe@thefrontiergroup.com> wrote in message
    > news:eAXB%23JTVDHA.3232@tk2msftngp13.phx.gbl...
    > > running code like:
    > >
    > > for each ofield in rs.fields
    > > response.write ofield.value
    > > next
    > >
    > > Getting and error that says TYPE MISMATCH. I KNOW that value is a
    correct
    > > type, right???
    > >
    > > Using SQlserver
    > >
    > > --
    > > Joe Resudek
    > > Frontier New Media
    > > 225 Crummer Lane
    > > Reno, NV 89509
    > > (775) 824-4040
    > > (775) 824-4044 fax
    > > [url]http://www.thefrontiergroup.com[/url]
    > >
    > >
    >
    > On the assumption they are char fields, you might have some nulls,
    > concatenating with an empty string will sort it.
    >
    >
    > for each ofield in rs.fields
    > response.write "" & ofield.value
    > next
    >
    > If they are not char fields, test for null first.
    >
    >
    >
    > --
    > John Blessing
    > [url]http://www.LbeHelpdesk.com[/url] - Help Desk software at affordable prices
    > [url]http://www.free-helpdesk.com[/url] - Completely free help desk software !
    > [url]http://www.lbetoolbox.com[/url] - Remove Duplicates from MS Outlook
    > [url]http://www.lbesync.com[/url] - Synchronize two Outlook Personal Folders
    >

    Joe Resudek Guest

  6. #5

    Default Re: Classic ASP, Trouble with fields.value

    Try this:

    response.write ofield.value & vbNullString

    I am guessing some fields have Null values.

    --
    Manohar Kamath
    Editor, .netBooks
    [url]www.dotnetbooks.com[/url]


    "Joe Resudek" <joe@thefrontiergroup.com> wrote in message
    news:eAXB%23JTVDHA.3232@tk2msftngp13.phx.gbl...
    > running code like:
    >
    > for each ofield in rs.fields
    > response.write ofield.value
    > next
    >
    > Getting and error that says TYPE MISMATCH. I KNOW that value is a correct
    > type, right???
    >
    > Using SQlserver
    >
    > --
    > Joe Resudek
    > Frontier New Media
    > 225 Crummer Lane
    > Reno, NV 89509
    > (775) 824-4040
    > (775) 824-4044 fax
    > [url]http://www.thefrontiergroup.com[/url]
    >
    >

    Manohar Kamath [MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139