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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Illegal Operation in Cold Fusion Extention (CFX) 1

Status
Not open for further replies.

mkyzar

Programmer
Joined
Oct 19, 2000
Messages
56
Location
US
Illegal operation in Cold Fusion Extension (CFX)

You have attempted to refer to an invalid row/column combination of a query.

This query contains 1 rows. You can call CCFXQuery::GetRowCount to determine the number of rows contained within a query.

You can call CCFXQuery::GetColumns to determine the number of columns contained within a query.

The error occurred while processing an element with a general identifier of (CFHTTP), occupying document position (13:1) to (13:322).


Date/Time: 09/06/01 09:43:12
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; YIE6)


This is the strange message I've started getting when using CFHTTP to get the contents of a text file. Can anyone tell me what this means and point me in the right direction to fix it? It was working perfectly and then stopped. Any help is appreciated.
 
How many lines does your text file contain? - tleish
 
It will vary but currently the file I'm working with has around 4500 lines.
 
What does your code look like? Is there anything you modified in your code or txt file before it stopped working, or were you was you monitor tilted wrong and it broke the app all of the sudden? :-) - tleish
 
It seems as though my monitor must have been tilted wrong because I honestly don't know what I could have done. The code is kinda lengthy because I've had to specify a long list of columns but is as follows:

<cfhttp url=&quot; method=&quot;GET&quot; name=&quot;getdata&quot;
columns=&quot;dept,fill1,primary_location,item_use_c,
major_id_c,intermed_c,minor_code,model_year,description,
serial_number,make,report_no,acqui_date,voucher_no,
mfc_number,cost,field18,type,sub_location,vehtype,
tagno,roomnumber&quot; delimiter=&quot;,&quot;>
</cfhttp>


The only thing I remember doing before it blew up was re-exporting the data to the text file to be used.
 
Can you post at least 2 lines of your txt file? - tleish
 
&quot;451&quot;,,&quot;200&quot;,&quot;3&quot;,&quot;41&quot;,&quot;0154&quot;,&quot;007&quot;,,&quot;AIR CONDITIONER&quot;,&quot;21PT15407&quot;,&quot;GE&quot;,&quot;001&quot;,&quot;011960&quot;,&quot;EXC60&quot;,
&quot;0002753&quot;,16300,,&quot;0&quot;,&quot;220&quot;,,,

&quot;451&quot;,,&quot;200&quot;,&quot;3&quot;,&quot;37&quot;,&quot;6349&quot;,&quot;049&quot;,,&quot;PLANTER TREE&quot;,&quot;TMA6443&quot;,&quot;UKN&quot;,&quot;001&quot;,&quot;121959&quot;,&quot;51444&quot;,&quot;0003662&quot;,71270,,&quot;0&quot;,&quot;270&quot;,,,


These are the first 2 lines.
 
Do you have a &quot;nothing&quot; string at the beggining of your file?

================
Blah: The first line of text is skipped by CFHTTP
&quot;451&quot;,,&quot;200&quot;,&quot;3&quot;,&quot;41&quot;,&quot;0154&quot;,...
&quot;451&quot;,,&quot;200&quot;,&quot;3&quot;,&quot;37&quot;,&quot;6349&quot;,...

================ - tleish
 
I'm learning coldfusion as I go along and what I am doing might be a little crazy, but I use cffile to read the file in and determine what the first record is by using an array and then using cffile to append the first record to the end so I make sure it gets in there.
Like this:

cffile action=&quot;read&quot; file=&quot;\\win2000-web\c\inetpub\ variable=&quot;inventory&quot;>

<cfloop list=&quot;#inventory#&quot; Index=&quot;i&quot; Delimiters=&quot;#chr(10)#&quot;>
</cfloop>

<cfset file_array = arraynew(1)>

<cfloop list=&quot;#inventory#&quot; Index=&quot;i&quot; Delimiters=&quot;#chr(10)#&quot;>
<cfset i = arrayappend(file_array, i)>
<cfset record=#file_array#>
</cfloop>

<cffile action=&quot;append&quot; File=&quot;\\win2000-web\c\inetpub\ Output = #file_array[1]#>
 
I'm pretty sure that's the problem right there. The script in the page runs pretty fast, and it's trying to write to the file and read from it at the same time -- it's getting confused.

Just for testing, try commenting out the CFFILE lines that read and write to the file and see if the error still shows up.

Also, each time you run the script your text file gets longer and longer. It goes from

Line1
Line2
Line3
to
Line1
Line2
Line3
Line1
to
Line1
Line2
Line3
Line1
Line1 - tleish
 
Actually, I've already tried that and it gives me the same error. I've run across another theory that I am about to test. If it works, I'll let you know. I really appreciate all the time you've spent helping me. :)

mkyzar
 
Actually, looking at it again what's happening to the txt file is this:

Line1
Line2
Line3
to
Line1
Line2
Line3Line1
to
Line1
Line2
Line3Line1Line1
to
Line1
Line2
Line3Line1Line1Line1

So you'll need to fix the last line of the text file as well.

I recommend just putting in a placeholder nonsense txt on the first line of your txt file, and that way you won't need to worry about this problem - tleish
 
I'm having to delete the last line of the text file each time for testing purposes. When I'm done with this bit of code, it will be used to automate the import of the text file to an access database. There will be a new text file each time so once it is working correctly, there shouldn't be a need to delete the last line. In other words, every month the txt file will be over-written and this code will only be executed once a month. Do you think that will work?
 
Also, I've noticed that the original text file actually puts the cursor at the beginning of where the next record should be in the file, so as long as that happens the first record will be copied to the bottom correctly.

Line1
Line2
Line3
Line1

If during testing I don't delete that last line when I re-execute the page, you are correct.

Line1
Line2
Line3Line1

The theory I'm looking at now is maybe when the new text file is read in the positions of the data has changed. If that is so, would it give that error if the columns and data aren't matching?
 
My theory did not work, of course. I've taken everything out of the file except the cfhttp line. I'm getting the same error message. I don't know what else to do. How else can I accomplish what I am trying to do? Thanks again for your time.
 
I'm willing to help as much as I can.

Have you taken a thorough look at your txt file? Are you sure there's not a line in there somewhere that has more commas that any of the other lines?

What's the entire purpose of this app from begging to end? Is it taking info from one db to another? Is it taking info from an Excel sheet to a db (if it is and it doesn't need to be automated, there's a simpler way to do this), or what? - tleish
 
At one of our remote locations where our company inventory file is maintained, the lady there will be exporting a text file to me that contains our inventory data. It will be done once a month. The text file needs to be imported into an Access database to be used with our coldfusion apps. We are just trying to automate the process. The columns that I am specifying in the cfhttp tag are all the columns in the export specification coming from the remote location. From what I can tell so far, all the fields are accounted for in each row of the text file. I had this working until I imported a new text file and that's when it blew up. I reverted to the old file to see if I could find the differences, but it's refused to work ever since.
 
What is she exporting it from? - tleish
 
She is exporting from a program called Protege which I think uses Paradox tables.
 
Can you post a temp url of where I could download the txt file? - tleish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top