Coldfusion Nondescript Error Message - excel

I have a coldfusion application that queries an oracle database for some data, converts the query into a CSV variable via a function creaeted by Ben Nadel, and is supposed to use a tag to then convert the csv value into an excel spreadsheet. However it is giving me the following error:
"The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
3
The error occurred in C:/inetpub/wwwroot/APPS/CapDB/generate_extract.cfm: line 312"
Here is the section of code it is referencing:
<cfspreadsheet action="Write" filename="C:\inetpub\apps\capdb\files\extract.xls" format="csv" name="strOutput" overwrite="true">
I've tried sending it different csv variables, even one created by Ben Nadel to work specifically with his custom function and the cfspreadsheet tag. The only thing that changes with the error when I use different csv variables is what number is displayed. I've seen 3 and 35 so far. Has anyone ever encountered an error like this before?

Related

Excel VBA - Upload into MS Access - Error 3051

Background:
I have an Excel file that is a workflow tool for one of our teams. One of the key processes is importing data from csv files and then uploading into MS Access. This part of the process works fine every time, no errors.
I added a new process to the tool, similar to the one mentioned above, this process scans data from one sheet and if a row meets a criteria it is copied into another sheet. Once the analysis is complete it gets uploaded into MS Access using the following code:
objAccess.DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tb_age_extract", Application.ActiveWorkbook.FullName, True, "AGEUPLOADDATA"
The strange thing is this will run ok for me but when the users try and run it they get a runtime error 3051, the full error message is:
The Microsoft Access database engine cannot open or write to the file '\Folder1\Folder 2\FileName.xlsm'. It is already opened exclusively by another user, or you need permission to view and write its data.
I ran a test using a 50 count loop, all 50 runs ran ok with no errors, then the user tries to run it and they get the error. I have also experienced the error as well on my machine.
What is puzzling is the error is sporadic.
Has anyone experienced something similar with a 3051 error?

Insert data into database using sqlldr in coldfusion

I have a CSV file that I got from a website. I need to upload that same CSV file into my database using SQLLDR in ColdFusion. For some reason I'm not able to insert the data into database.
Below is my code. Using this code I was not able to insert the data into database from the CSV file. It is working file from a batch file, but it is not working using cfexecute. By that I mean, I'm getting a blank screen. No errors, no exceptions, nothing. Checked in the logs but I did not get any errors there either. Only thing what I can see is that the data is not inserted into the database.
FYI, we are using Linux environment, so the path is slightly different.
<cfset CTLPATH="/home/mosuser/apps/nodal/ctl">
<cfset LOGPATH="/home/mosuser/apps/nodal/logs">
<cfexecute name="/opt/oracle/product/12.1.0/client_1/bin/sqlldr"
arguments="userid/password#Sid control=#CTLPATH#/mpimReport.ctl
log=#LOGPATH#/#PathfileName#_load.log data=#filelist##PathfileName#.csv
bad=#LOGPATH#/#PathfileName#_error.txt">
</cfexecute>
Update:
As suggested, dumping the error variable qryerr showed:
Message 2100 not found; No message file for product=RDBMS,
facility=ULMessage 2100 not found; No message file for product=RDBMS,
facility=UL
Add a few parameters to your <cfexecute> call.
timeout - in the order of the number of seconds expect the process to take
variable - the name of the variable to hold the STDOUT output of sqlldr
errorVariable - name of the variable to hold the STDERR output of sqlldr
After doing that you can get the output of the call and inspect it for any error messages and other info.
Adding the timeout is the crucial step - this makes cfexecute block until either the program terminates or the timeout is reached. Without a timeout, ColdFusion simply kicks off the process and immediately continues executing the rest of the current page.

Runtime error 5

I am on Day one in learning Excel Macros. As per the tutorial I recorded the macros and tried to run it. (I have used the same file that they have provided in the tutorial and it is a .csv file)
But it showing me the following Error
Runtime Error
Invalid Procedure call or Argument
When I tried to debug it is showing as follows:
Need Help
-Thanks
You can set the CommandType property only if the value of the QueryType property for the query table or PivotTable cache is xlOLEDBQuery, which is enum 5.
This is not the case for your query. In fact, that line doesn't even exist in the source code. Perhaps you attempted to merge scripts? If so, be careful when merging connection code that the types are the same.
If you add in a debug line to get the QueryType
Debug.Print .QueryType
.Name = "receipts"
you will get the enum 6 back. You can look this up using the object explorer:
As would be expected from the connection specification:
ActiveSheet.QueryTables.Add(Connection:="TEXT;

Problems came up in the following areas during load: Table

I have generated an excel file from xml. But i can not open it with Excel. Excel gives the following error opening it:
Problems came up in the following areas during load:
Table
Then it shows a message that the log file corresponding the error can be found at : C:/Documents and Setting/myUserName/Local Settings/Temporary Internet Files/Content.MSO/xxxxx.log
But i can not find Content.MSO folder in my windows. I checked folder settings and made all folders visible but i still can not access this folder. So that i can not analise the log file.
how could i find the generated log file?
I found the problem without analising the log file. i stil can not access the log file in temporary internet files. But i realised that i put a string(non-number) characters on a number-styled cell in Excel xml. So if you having the similar issues about your Excel file generated from xml, then have a look at if your cell values are appopriate with your cell data type.
If you type or paste the path of the log file into Explorer or your text editor of choice, you may find that the folder does exist, despite being invisible.
In my case it was a <Row> with an incorrect ss:Index
I was using a template and the last row had a fixed Index=100. If the number of rows I added exceeded 100, this last row had a wrong index and excel threw the error without any other message or log (MacOSX, Excel 15.25.1). I wish they printed more informative error messages, what a waste of our time.
Excel 2016. My error message was "Worksheet Settings". Path was pointing to non-existing file.
My cause of the problem was ExpandedRowCount not big enough for number of rows in Worksheet. If you add rows in XML directly (i.e. on a machine where Excel is not installed), make sure to increment number of rows in ExpandedRowCount.
yes.Even i too faced the same problem and problem was with the data type of cells ofexcel generated using xslt
In addition to checking the data being used vs "Type" assigned, make sure that the list of characters that need to be encoded for XML are indeed encoded.
I had a system that appeared to be working, but then some user data including & and < was throwing this error.
If you're not sure what's going on with your file, try http://www.xmlvalidation.com/ - that helped be spot the issue in a large file immediately.
I used this function to fix it, modified from this post:
function xmlsafe($s) {
return str_replace(array('&','>','<','"'), array('&','>','<','"'), $s);
}
and then run echo xmlsafe($myvalue) where you were just echoing $myvalue in your script.
This seems to be more appropriate for XML than htmlentities() or other options built into PHP.
I had the same issue, and the answer was - type of Cell was Number and some values doesn't converts to this type on my backend.
I had the SAME problem,
and its because de file is TOO BIG.
I try an extract from SAP, more little than the one with that make the error) and save it in XML file. and it WORK, no more error.
so maybe if you can save in 2 Excel files XML instead of 1 it will be good ;)
ALicia

MVC3 return File action causes intermittent Excel program error

I have a problem that closely relates to this problem Microsoft Excel Error: "There was a problem sending the command to the program." whereby opening Excel gives There was an error sending a command to the program error.
However, rather than the file existing and being opened or shortcutted-to, I am using MVC3 with an action that generates a bunch of data, generates an excel file (using NPOI), writes it to a MemoryStream and then chucks that to the browser using the built-in return File(etc) ActionResult, with something akin (but shortened here to aid readability) to this:
return File(myMemoryStream, "application/vnd.ms-excel", "filename.xls");
The first time you click the link which fires this action and returns this File - it comes up with the error. if you press ok and try it again it works, and will continue to work... forever
Now I know this is potentially something to do with disabling DDE/plug-ins or something in Excel - but since I'm generating an excel workbook and dumping it to a memory stream rather than opening something that exists permanently on the file system, I'm not sure what options I have to remove the issue.
Any suggestions on how to get around it? Perhaps I have the wrong mime-type?
The Content-Type application/vnd.ms-excel is sending the command to the Browser to open the file in the Browser. Which can be the cause of issue. Try setting the content type to application/x-msexcel.
In your example the browser will try to open an Excel spreadsheet in the browser (if the user has Excel installed).
return File(myMemoryStream, "application/vnd.ms-excel", "filename.xls")
Please make the following change
return File(myMemoryStream, "application/x-ms-excel", "filename.xls")

Resources