Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any ideas. I am running a script t

Status
Not open for further replies.

sshafe

Programmer
Oct 18, 2002
71
US
Any ideas. I am running a script to do some inserts and deletes. Once I hit 10 inserts (or deletes), I am trying to issue a commit with this code:

If line_ctr = 10 Then
Commit = cnMcLDBA.Execute("commit;")
line_ctr = 0
MsgBox "Commit done"
Else
line_ctr = line_ctr + 1
wscript.echo line_ctr
End If

I am getting the following error:
[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.
Code: 80040E57.

Any clue how to fix?
 
sshafe,

Your length of your data is greater than what you have defined it in your database. In other words, if you have a field called "comments" of 80 characters and someone has entered 90 characters in a variable called "strComments", it looks like the execution will truncate the 10 characters off strComments.

Either redefine your field's size or limit the user's input.

fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top