Professional Web Applications Themes

Size of Smallint field returned by ODBC to VB6 - IBM DB2

Programmer is using objField.DefinedSize in VB6 to calculate the size of a display "mask" in the screen. This appears to work fine for character fields, but returns a 2 for smallint and 4 for Integer. I suspect he's getting the number of bytes in the field, not the true maximum size for the display. Is there a different attribute that should be checked? Thanks, Fred....

  1. #1

    Default Size of Smallint field returned by ODBC to VB6

    Programmer is using objField.DefinedSize in VB6 to calculate the size
    of a display "mask" in the screen. This appears to work fine for
    character fields, but returns a 2 for smallint and 4 for Integer. I
    suspect he's getting the number of bytes in the field, not the true
    maximum size for the display. Is there a different attribute that
    should be checked?


    Thanks,

    Fred.
    Fred Guest

  2. #2

    Default Re: Size of Smallint field returned by ODBC to VB6

    "Fred Prose" <com> wrote in message
    news:google.com... 

    Yes, those are the number of bytes used by DB2 to store the values. The
    largest numbers they can contain are as follows:

    Smallest INTEGER value ?2 147 483 648
    Largest INTEGER value +2 147 483 647

    Smallest SMALLINT value ?32 768
    Largest SMALLINT value +32 767


    Mark Guest

  3. #3

    Default Re: Size of Smallint field returned by ODBC to VB6

    > Yes, those are the number of bytes used by DB2 to store the values. The 
    Sorry, the correct numbers should be:

    Smallest INTEGER value -2,147,483,648
    Largest INTEGER value +2,147,483,647

    Smallest SMALLINT value -32,768
    Largest SMALLINT value +32,767

    I have no idea how VB6 displays these, but you try using these maximums to
    see what happens.


    Mark Guest

Similar Threads

  1. Question changing font size in a form field that auto-selects text size
    By Unregistered in forum Brainstorming Area
    Replies: 0
    Last Post: June 19th, 04:18 PM
  2. Replies: 0
    Last Post: May 6th, 09:27 AM
  3. sql query returned a to table in a field
    By Gm3512 in forum Dreamweaver AppDev
    Replies: 0
    Last Post: May 1st, 11:14 PM
  4. WIN32::ODBC dropping SPACES in XML returned by SQL Server
    By Doug Wyrembek in forum PERL Modules
    Replies: 0
    Last Post: January 10th, 07:01 PM
  5. #25544 [Ver->Bgs]: Only 255 characters returned from varchar field
    By abies@php.net in forum PHP Development
    Replies: 0
    Last Post: September 16th, 09:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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