String Index out of range means that you are trying to put data into a column that doesn’t fit.  Check your Max length’s on your form controls compared to your database columns.  I believe that will help resolve your issue.

 

And Ferg’s right…STOP USING CFINSERT.  J  It’s a crappy tag and I believe has been deprecated.

 

Dan

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric C Sandquist
Sent: Monday, February 28, 2005 1:49 PM
To: [email protected]
Subject: RE: String index out of range: -2 null <br>The error occurred on line 28.

 

Great idea...  Using a full sql query I was able to identify a column name that had gotten changed by another developer...  FIxed it, now working again...  The cfinsert tag didn't give me enough info on its error to identify it readily, but the full SQL did...

 

Eric

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ken Ferguson
Sent: Monday, February 28, 2005 12:37 PM
To: [email protected]
Subject: RE: String index out of range: -2 null <br>The error occurred on line 28.

Does this error occur every time the script runs or only under special conditions? If not every time, have you figured out what the special conditions are so that you can duplicate the error on command?

 

I think that the two easiest ways to nail down your exact problem are these:

 

1.       rewrite the code as a cfquery with an insert statement and see if you get a more useful error message

2.       open QA and run the exact query (same data…)  that was being run on a page which produced the error and see what happens

 

Either of these two methods should give you a much better starting point. I haven’t used SQL Server in a couple of years, but it looks like one of the elements in your insert doesn’t jive with the constraints or type-defs of the column into which it’s going.

 

--Ferg

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric C Sandquist
Sent: Monday, February 28, 2005 11:46 AM
To: [email protected]
Subject: String index out of range: -2 null <br>The error occurred on line 28.

 

 

 

I have an application with a series of data collection and insertion pages ann in the last 2 weeks started receiving this error in my Request Error template:

Error.Diagnostics: String index out of range: -2 null <br>The error occurred on line 28.

 

Line 28 of the code consists of the following:

<CFINSERT datasource="#Application.DSN#" tablename="retailattributes" formfields="anchor1, anchor2, anchor3, trafficcountNS, trafficcountEW, parkingratio, propidnumber, radius1, population1, HH1, HHincome1, radius2, population2, HH2, HHincome2, radius3, population3, HH3, HHincome3">

Has anyone else ever gotten an error such as this? It is just a simple insert, all the other pages work, It is just this one spot... The database is in SQL 2K.  I can't seem to find reference to -2 anywhere regarding this message type...

 

Eric

 

 


I am using the free version of SPAMfighter for private users.
It has removed 87253 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!

 


I am using the free version of SPAMfighter for private users.
It has removed 87253 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!

Reply via email to