VB5 problem when selecting data from SQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dave jones
    New Member
    • Mar 2011
    • 5

    #1

    VB5 problem when selecting data from SQL

    I am currently importing data from an SQL table into a local array in VB5. It goes along fine but then I get the following error:

    Run-time error 3163 The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data

    The code involved is:

    [Set dclpkv = rN2.Fields(1)
    Set dclfn = rN2.Fields(2)
    Set dclnv = rN2.Fields(3)
    Set dclisd = rN2.Fields(4)
    Set dclufk = rN2.Fields(5)
    Set dcldt = rN2.Fields(6)
    lukpk$ = dclpkv]

    The debug lights up the last line.

    When I look at data in the immediate window, I can put lukpk$ into a text box. When I try to put the dclpkv into the text box, I get the same error. I tried setting all the dcl...'s to nothing before each set of a field. ??? (help)
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    check the max length of your textbox, they arent unlimited by default.

    Comment

    • dave jones
      New Member
      • Mar 2011
      • 5

      #3
      The error is not when I try to put it into a test box...it appears immediatlely when I try to access the data immediately after the set statements.

      Any other suggestions.... I'll look at them all.

      Thank you !!

      Comment

      Working...