Results 1 to 2 of 2

Thread: Error while Compile. Please Help!

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Location
    Kuala Lumpur, Malaysia
    Posts
    3

    Unhappy Error while Compile. Please Help!

    I am developing a VB application using ActiveX EXE, everthing is okay and well functioning, but don't know what happened yester day my program has an error that I can't solve it. the error message is as below:

    run_time error-2147217833 (80040e57)
    [microsoft][ODBC SQL Server Driver][SQL server]
    String or binary Data would be truncated.

    when I debug they highlighted the code as below:

    oConn.BeginTrans
    FundCode = txtFundCtgy & "-" & txtFundCode & "-"

    For I = 1 To MSFlex.Rows - 2

    amt = 0 - MSFlex.TextMatrix(I, 5)
    sqltext = "INSERT INTO Acc_GL (Acc_Code,Description,Amount,Ref_1,Ref_2,Acc_Date,KeyIn_Date,KeyIn_By)" & _
    "VALUES ('" & FundCode + MSFlex.TextMatrix(I, 0) & "','" & MSFlex.TextMatrix(I, 3) & "','" & amt & "','" & MSFlex.TextMatrix(I, 1) & "','" & MSFlex.TextMatrix(I, 2) & "','" & DTAcc.Value & "','" & SysDate & "','" & strUserID & "')"

    oConn.Execute sqltext
    UpdateTB DTAcc.Value, FundCode + MSFlex.TextMatrix(I, 0), amt

    Next
    oConn.CommitTrans


    Please help me, because my program have been delay for 3 days already.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    truncated means cut-short, so "String or binary Data would be truncated. " means that a String or Binary field is smaller than the data you are trying to put into it.

    check the length of the fields, then the length of the data you are trying to put into them - for at least one of the fields you are putting in too many characters

Posting Permissions

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



Click Here to Expand Forum to Full Width