VBA Excel run-time error useing Recordset.Open

  • I'm getting a run-time error '-2147217833(80040e57)' String or binary data would be truncated. Any ideas what is going on here? It was working fine until another SQL Call was added to a second form within the excel worksheet. I did remove it but still getting this error so I'm currently STUCK. Your help and assistance is greatly appreciated and NEEDED.


  • Re: VBA Recordset.Open Error

    You don't give details of the actual SQL statement, but that error is usually raised when trying to append data into a table (as in database table) but the data for one, or more, of the fields is longer than the defined length of the field - and I am aware your thread title says 'Open Error'...

  • Re: VBA Recordset.Open Error

    Thank you cytop! With your information I was able to find the problem and you were correct. It did end up to be a size issue based on a SQL column definition. The VBA variable was 1 byte larger than the SQL Definition it was writing to.

    I appreciate your help tremendously. You have saved me alot of time and frusration.

  • Re: VBA Recordset.Open Error

    Shot in the dark, but the error message is usually fairly accurate.

    Please make sure you update your other thread on VBForums - save anyone taking the time to reply if it is already solved.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!