Integrated Application using getcurrentcompanyfilename results in error - quickbooks

I use
qbxmlrp.getcurrentcompanyfilename
(using qbxmlrp2) in QB 2011, 2012, and 2013 (sometimes) I get error 2147220470 and the message "QuickBooks is already open and the file is different from the one requested, or there are multiple instances of QuickBooks running."
Some of the users have reported the errors began after opening multiple QB files simultaneously via Windows explorer.
Is this because of the use of Windows Explorer to open the .qbw file directly? How do overcome or code around it?

This error:
QuickBooks is already open and the file is different from the one
requested, or there are multiple instances of QuickBooks running.
Pretty much explains exactly what the problem is. Due to the way QuickBooks itself is designed, API/SDK connections do not work if:
your app tries to open a different QuickBooks file than is already open
there are multiple QuickBooks company files open at one time
There is no work-around, it's a limitation of QuickBooks itself.
If your app needs to communicate with QuickBooks, then the end-user needs to either have no QuickBooks company files open, or the company file that you're trying to connect to open.

The problem was the error number returned for the wrong file name is the same as the number returned when multiple instances of QuickBooks are running - I can't tell which is occurring. Combine this with path aliases of Win7 sometimes changing intermittently and you get confusion and complex error handling code requirements. In short, if others need to store both file and path of linked QB files, I suggest allowing aliases.

Related

Unable to Run my Code on Windows Server 2012 X64 as Windows Task

Let me give you some background what I'm trying to achieve before I call out the problem.
Use TFS API to Get Services Work Item.
Get all the Open Bugs.
Write in excel all the Open Bugs (from step2).
Send step3 Excel as Attachment through SMTP.
Schedule a Windows Task on Windows Server 2012 and X64 to perform above steps on daily basis.
Problem:
While running step5 I'm not able to write into Excel using OLEDB because of exception"The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine". To resolve this issue, I have build my project Platform Target=X64.
The excel issue is resolved but I'm not able to access TFS API because it is not able to load DLL Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader.
Kaleem.
If you get the following error message: "Could not load file or assembly ‘Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader’ or one of its dependencies. An attempt was made to load a program with an incorrect format". Please take the solution described in this blog: http://www.tonicodes.net/blog/installing-and-configuring-odata-service-for-tfs-11/

How can I activate Xamarin.Android for use on a CI server?

My company owns several business licenses for Xamarin.Android, and we'd like to use this on our CI server. However, it seems that I'd need to install the full Xamarin suite on my CI server including Visual Studio Pro to make this work. My question is, using the vanilla Xamarin.Android package, how can I activate it?
It seems that installing this on its own adds the Xamarin.Android tools and libraries to build with but there is no way to activate it that I can find, so when I attempt to build using MSBuild, the build fails with this error:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(299,2): error XA9008: Building from the command-line requires aÿBusinessÿLicense.
Now, after some googling, I have found that the activation tool is called "mandroid.exe", which can be found in C:\Program Files (x86)\MSBuild\Xamarin\Android - although I have found references to this being in the 64-bit program files too.
Unfortunately, I can't find any suitable documentation on this tool. Every time I find a thread where someone discusses this, someone from Xamarin jumps in and says "contact support#xamarin.com". After a while I did that but two business days later there still is no response and I've got deadlines to meet so I thought it might be helpful for everyone involved for us to publicly document this process.
The best thing I've found comes from a thread on the Xamarin mailing list which references this invocation:
mandroid.exe --activate --name "NAME" --company "COMPANY" --email "EMAIL" --phone "PHONE" --code "ACTIVATION CODE"
I have also discovered another variant of this invocation that looks like this:
.\mandroid.exe –activate –activation-name="NAME" –activation-phone="PHONE" –activation-company="COMPANY" –activation-code="CODE" –activation-email="EMAIL"
I've tried many permutations of my account data here using both invocations - using the activation code from the products page on the Xamarin store. No matter what though, this error occurs:
\mandroid.exe : monodroid: error XA9997: Incomplete data provided to complete activation
In the "problems activating?" section of the products page, it says this:
In Mono for Android 1.0.21316 and later, if activation within Visual Studio fails then a MfaActivation.dat file will be created within the Documents folder. Select this file below.
Perhaps there's some way to force this file to be created by mandroid.exe? That would be very helpful. While I imagine that offline activation is the only way to make this work, I would accept any answer that involves uploading MfaActivation.dat or otherwise invoking the online activation machinery as well.
Update - I'm afraid that the below steps no longer work. Xamarin has updated their activation system to activate by a different method for newer versions.
In the end I had to install Xamarin Studio as part of the Chef configuration and just instruct administrators to manually activate the software as part of creating a new build node. I had no luck trying to reverse engineer a fix, and if I did, it would probably just break again.
It turns out that I almost had it correct. The second invocation I specified is actually the correct way to call this command but the -- part was apparently converted to a – token by some blog software somehow.
The --activate verb will perform an online activation with Xamarin's servers, so I'm still not sure how you'd do it without an internet connection.
For reference, here is how I did it:
mandroid.exe -v --activate --activation-name "(NAME)" --activation-phone "(PHONE_" --activation-email "(EMAIL)" --activation-company "(COMPANY)" --activation-code "(CODE)"
I'm not sure about the significance of the -v switch, but perhaps that would make it output debugging info if there was a problem.
You must enter all the information exactly as specified on your products page - select one of your licenses and select "problems activating?". However, you will need to enter the licensee name - i.e. the user who owns the license in the --activation-name parameter which must correspond to the --activation-code parameter.
After doing this you can call mandroid with the --activated switch which returns an exit code:
PS> & .\mandroid.exe --activated
PS> $LastExitCode
0
You will also be able to reload the products page and you should see that your license for the chosen user has a new computer registered to it.
This does use up another activation but if you e-mail the support team you can sign the build server agreement and then I assume they can set you up with additional activations for your build nodes.
It's a shame that this wasn't documented better because this has wasted my time for several days. Hopefully this will be helpful to someone else with the same situation.
From Xamarin documentation, we can see
http://docs.xamarin.com/guides/cross-platform/ci/configuring_tfs/
"Visual Studio Professional (or greater) must be installed on the Team
Foundation Server along with licensed copies of Xamarin.Android and
Xamarin.iOS to support development of Android and iOS mobile
applications via the Team Foundation Server."
So I assume that in all cases you need to have VS + Xamarin products installed and activated.
I might be wrong, so the best way is to contact Xamarin support, http://xamarin.com/support

Radstudio and Interbase license issue?

I had my RadStudio setup all working and have created a very simple mobile app for android that uses IBLite to grab some data. For business reasons I had to leave the project and move on to other things. So I come back to Radstudio thinking I can just pick up where I left off.
I notice there is an update for the product so I apply the changes and then open up my previous project. From there things get very strange. I can build and deploy to android and the project still works. If I deploy to IOS simulator again no problem and everything works fine. As soon as I try to deploy to a device I get the following compiler error:-
[DCC Error] E2597 ld: library not found for -libtogo
(This is an outstanding question on Embarcadero Developer Forum)
Which looks to me like a problem with the licence file. So I try to manually add it to the deployment but still get the error. So I decided to park my project and go back to the IOS IBLite tutorial from the Embarcadero website. I get to the stage where I want to drop an sqlconnection to the form and connect to the database... No joy it comes up with unavailable database which I thought might be a licensing issue or the fact the IB Server was not running. So I double checked the latter and sure enough it is running as a windows service and I can use IBConsole to connect to it.
So I drop trying to create a mobile application and try to create a desktop app that connects to the dbdemos database. No luck, the ide still states unavailable database...
So to my question?
How do I get radstudio to pick up the license for Interbase and particulary IBLIte for IOS?
I have searched online and on the EDF and have been unable to find a solution.
Take a look to this link.
IBREDISTDIR environment variable should be properly configurated with the directory containing library folders and licenses.
RAD Studio links statically libibtogo.a probably this file is missing. This file usually is into ($BDS)/lib/iosDevice/debug path

ActiveReports 7 throws invalid handle exception printing from Windows Service

I have and application that is running as a windows service on Server 2008. When I run it as an application and send a print job, the print job gets processed sucessfully. However, if I send the print job to the windows service instead, it throws "The Handle is invalid" exception.
Here is the error:
Printing Thread error: The handle is invalid. StackTrace: at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e) at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print() at GrapeCity.ActiveReports.Viewer.Win.Printing.PrintImpl.DocumentPrinter.<Print>b__1e()
The service is running under an administrator account which has admin permissions.
Any help would be appreciated!
A coule things to check:
Make sure that the user account that the service is running under has the proper printer installed under his account and that it is set as the default printer.
Make sure you're using the Print method in ActiveReports that explicitly does not show any UI.
Try checking the "Allow service to interact with desktop" checkbox on the service's property page from the Services control panel applet. Although you may not be showing any UI, the printer driver may need that capability.
Finally, just keep in mind that in general printing from a Windows Service is kind of flaky. Even Microsoft's documentation for System.Drawing.Printing has the following disclaimer:
Classes within the System.Drawing.Printing namespace are not supported for use within a Windows service or ASP.NET application or service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions.
That doesn't mean it won't work, but that it is error-prone enough that Microsoft doesn't want to help us printing in this case. I suspect this is because the printer drivers from the manufacturers are not necessarily designed for printing from non-UI processes like windows services.
Roussul
It could be a permission or printer access problem. To check whether it is related to ActiveReports or not, can you create a separate app, implement system.printing.drawing and run it as a service, just as you have it with ActiveReports and let us know.
I had this issue in a ASP.NET application. The root cause was that "Enable 32-bit applications" had been set in the IIS application pool that the website was running in.
It appears the print function tried to connect to a 32 bit driver rather than the 64 bit drivers that were installed.
Maybe in a .NET Windows app the "Target CPU" setting could also cause a similar issue? ie if you target x86 and try and run your app on x64 it will only connect to 32bit printer drivers?

"There is insufficient memory. Save the document now." error while opening word 2003 document

I have developed one windows service through which I am trying to open an word document. But when service tries to open document, it logs following error "There is insufficient memory. Save the document now."
If I run the same program as normal windows application, it works fine but problem comes only when I try to run the program as windows service.
I tried to google this problem, but there arent many answers about this problem. Is there any way to increase the memory limit for windows service or process? Something like in Java world, where we can specify memory limit while executing java class java -Xmx800M. Is there something similar for windows processes?
Does anyone knows how to solve this problem? I am using C#, .net framework 2.0 and office 2003 for development.
I found out that office automation is not recommended by microsoft on server side code.
More information can be found here.
EDIT :
I found one more article regarding office automation in server side code.

Resources