Matthew Steven Kelly

Just another WordPress weblog

Access QuickBooks from a Windows Service (such as Apache)

December15

Quickbooks Desktop Integration

I was trying to get a Apache/PHP application to interface with Quickbooks using QBXML through the Quickbooks SDK and kept receiving the following error:

  • “Could not start Quickbooks”

When looking at the SDK log file (Located at C:\Documents and Settings\All Users\Application Data\Intuit\QuickBooks\qbsdklog.txt), I kept seeing the following error when attempting access the file:

20091215.215811 I 3416 RequestProcessor ========= Started Connection =========
20091215.215811 I 3416 RequestProcessor Request Processor, QBXMLRP2 v7.0
20091215.215811 I 3416 RequestProcessor Connection opened by app named ‘php QB via C#’
20091215.215812 E 3416 RequestProcessor QuickBooks is not running and the data file name is not provided. Cannot continue.
20091215.215812 E 3416 RequestProcessor Could not create instance of QuickBooks. hr = 80040416
20091215.215812 I 3416 RequestProcessor Connection closed by app named ‘php QB via C#’
20091215.215812 I 3416 RequestProcessor ========== Ended Connection ==========
========= Started Connection =========
Request Processor, QBXMLRP2 v7.0
Connection opened by app named 'php QB via Apache'
An internal error occured while looking for a running instance of
QuickBooks. Cannot continue. hr = 800401f3
Could not create instance of QuickBooks. hr = 8004041c
Connection closed by app named 'php QB via Apache'
========== Ended Connection ==========

If I ran my integration application through command prompt (via a .bat file) instead of Apache it worked perfectly. But Apache would not sync. I was running the Apache service as an Administrator which is I though all I needed to do. I was wrong.

Apparently accessing QuickBooks from a Windows service requires special COM permissions, because there are in-process/out-of-process Windows COM issues. We basically need to do three things: configure the COM permissions for QBXMLRP2e (installed with the Quickbooks SDK), configure Apache to run as a Windows user and configure Quickbooks to allow the application to connect.

COM Permissions configuration:

  1. Make sure the Quickbooks SDK is installed.
  2. Run command prompt and type: “C:\Program Files\Intuit\IDN\QBSDK7.0\tools\access\QBXMLRP2e\qbXMLRP2e.exe” /RegServerThis adds qbXMLRP2e to the DCOM settings list.
  3. Run “Component Services” from “Control Panel > Administrator Tools”
  4. Then from “Console Root > Computers > My Computers > DCOM Config” right click on “qbXMLRP2e” and select Properties

“Authentication level” should be set to Default

Go in Security “Launch and activation” select “Customize” and press Edit. Add the Windows user the service runs as and assign all calling rights. “Access” select “Customize” and press Edit. Add the Windows user the service runs as and assign all. “Configuration” select “Customize” and press Edit. Add the Windows user the service runs as and assign all.

Go in “Identity” tab and select “The interactive user”

Click Apply.

Apache/Quickbooks configuration:

  1. Make sure Apache is running as the user configured as the DCOM Windows user. Right click on the Apache Monitor and select Open Services. Change the “Log On As” user for the Apache service.
  2. Open Quickbooks and set it to multi-user mode. Be sure to clear out any applications in “Preference | Application Settings” first to make sure the permission settings get set correctly.
  3. Run a GUI version of your application accessing quickbooks. For example running your program through command line instead of Apache.
  4. Follow the prompts in Quickbooks to allow the application access.
  5. Run the integration through Apache and it should work now!

This took forever to figure out and hopefully it helps someone googling the error codes I was receiving.

Windows 7 Starter Edition

November11

Recently purchased a netbook with Windows 7 on it a few weeks ago. I didn’t realize until I started using it the massive limitations of Windows 7 Starter Edition. This article articulates it pretty well: http://www.eweek.com/c/a/Windows/Microsofts-Windows-7-Could-Disappoint-Netbook-Users-Says-Survey-368762/

Even worse, when the netbook was first loading, they misspelled initializing as “Initailizing…”. My blackberry doesn’t take very good shots of LCD netbook screens, but here is the picture:

Windows 7 misspells initializing

Windows 7 misspells initializing as "Initailizing"

A coworker of mine is always talking about how great Ubutnu is: http://www.ubuntu.com/, and I do have an extra laptop to try it out on. So that seems like a nice weekend project.

Twitter Updates

October13

Two ways to add Twitter to your site. For the non-tech or easy to do, use Twitter’s built in widgets: http://twitter.com/badges/which_badge

Or using PHP code your own page. Below is the code followed by the results:


Warning: file_get_contents() [function.file-get-contents]: open_basedir restriction in effect. File(/home/content/k/e/l/kellymas/html/includes/include_twitter.php) is not within the allowed path(s): (/var/www/clients/client2/web2/web:/var/www/clients/client2/web2/tmp:/usr/share/php5) in /var/www/clients/client2/web2/web/blog/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 7

Warning: file_get_contents(/home/content/k/e/l/kellymas/html/includes/include_twitter.php) [function.file-get-contents]: failed to open stream: Operation not permitted in /var/www/clients/client2/web2/web/blog/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 7

Warning: include() [function.include]: open_basedir restriction in effect. File(/home/content/k/e/l/kellymas/html/includes/include_twitter.php) is not within the allowed path(s): (/var/www/clients/client2/web2/web:/var/www/clients/client2/web2/tmp:/usr/share/php5) in /var/www/clients/client2/web2/web/blog/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 13

Warning: include(/home/content/k/e/l/kellymas/html/includes/include_twitter.php) [function.include]: failed to open stream: Operation not permitted in /var/www/clients/client2/web2/web/blog/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 13

Warning: include() [function.include]: Failed opening ‘/home/content/k/e/l/kellymas/html/includes/include_twitter.php’ for inclusion (include_path=’.:/usr/share/php:/usr/share/pear’) in /var/www/clients/client2/web2/web/blog/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 13

Twitter

August26

Just signed up for Twitter: https://twitter.com/matthewstevenke

It is actually pretty cool. Not sure how much I am going to update it, but I set it up to be able to post “tweets” from my mobile phone. All I have to do is text whatever I want to 40404 and it shows up.

I debated with myself for quite a while on the username. Twitter only allows for 15 character user names, so “matthewstevenkelly” would not quite fit. Matthew Kelly is quite the popular (ie common) name, so “matthewkelly” and all kinds of other variations wouldn’t work either.

If you know anyone I should follow… let me know. I added Matt Cutts and Evan Eckard right away. More to come I am sure.

Social Media Revolution

August20

Are you using social media? Found this from http://www.cincyrecruiter.com/

Allow More Than One Remote Desktop Login Connection On GoDaddy’s Virtual Dedicated Server’s

August13

This bears repeating…

http://www.coderjournal.com/2008/02/multiple-rdp-godaddy-server-connections/

Ever have one of those days where you are so eager to get home and watch Lost that you totally forget to log out of your Remote Desktop instance? Well I have, and usually it is not a big deal, because Windows Server Terminal Services allows you to have multiple logins with the same user account. Unless you are running on GoDaddy Virtual Dedicated server, where the default configuration only allows one connection.

So I called up GoDaddy and they said my only option was to power cycle the machine. Gasp… Yes you head me right, a power cycle of a live running website. My heart actually skipped a beat when this level one tech said this. I also wasn’t allowed to talk to level two techs because they can only be graced with e-mail, talking to actual GoDaddy customers is beneath them I guess.

Well to make a long story short I found a way to increase my Maximum Connections to two, which is just enough to allow me to login with the Admin account and kill my other session. Here is what you have to do:

To Set Maximum Connections for Remote Desktop Connections

  1. From your servers’s Start menu, point to Programs, point to Admin Tools, and then click Terminal Services Configuration.
  2. In the right pane of the window, click RDP-Tcp.
  3. Click the Network Adapters tab.
  4. Change the Maximum Connections to 2.

Also while you are at it you may want to change the session log out time.

To Set Timeout Options for Remote Desktop Connections

  1. From your computer’s Start menu, point to Programs, point to Admin Tools, and then click Terminal Services Configuration.
  2. In the right pane of the window, click RDP-Tcp.
  3. Click the Sessions tab.
  4. Specify the values you want to use.

I usually set End Disconnected Sessions to 10 minutes and Idle Session Limit to 30 minutes.

I don’t know why the maximum connections for RDP isn’t set to a reasonable value as the default, but many of the default settings at GoDaddy and puzzling and disturbing. So it really doesn’t surprise me.

What is the MSPX file extension?

May27

Protect yourself: http://www.microsoft.com/protect/yourself/mobile/publicpc.mspx

I found that link and the first thing I thought was: what is a .mspx file extension? A lot of googling revealed to me that the answer lie at http://www.microsoft.com/backstage/bkst_column_46.mspx. Unfortunately, that is a dead link. Fortunately for me, nothing on the web goes away once posted (more about that regarding social networking photos, but I digress).

From the web archives:
http://web.archive.org/web/2004080…

“The presentation framework includes a custom Web handler built in ASP.NET. Pages that use the presentation framework have the .mspx filename extension, which is registered in Microsoft Internet Information Services (IIS) on the Web servers. When one of the Microsoft.com Web servers receives a request for an .mspx page, this custom Web handler intercepts that call and passes it to the framework for processing.

The framework first checks to see whether the result is cached. If it is, the page is rendered immediately. If the page is not cached, the handler looks up the URL for that page in the table of contents provided by the site owner (see below) to determine where the XML content for the page is stored. The framework then checks to see if the XML is cached, and either returns the cached content or retrieves the XML from the data store identified in the table of contents file.

Within the file that holds the content for the page, XML tags identify the content template to be used. The framework retrieves the appropriate template and uses a series of XSLTs to assemble the page, including the masthead, the footer, and the primary navigational column, finally rendering the content within the content pane.”

Now that is interesting. Oh, and so was this:
http://www.microsoft.com/protect/yourself/mobile/publicwireless.mspx

Animated GIF

May23

I saw this really neat animated GIF: http://www.w3schools.com/downloadwww.htm. So I thought it would be interested to create my own “Download the Internet” link…

So I headed over to gickr and created my own animated GIF image. Now with a lot more slides this would have come out pretty slick. Maybe when I have some more time (and am not spending my days reading MCSE books) I’ll update this to make for a smoother transition.

Although with so few slides, the internet is only a 1MB image!

Download the internet

What goes online stays online

May21

It seems that every day we are finding more and more that what goes online, stays online, whether you delete it or not. An interested read on CNN today about digital images not going away after being deleted: http://scitech.blogs.cnn.com/2009/05/21/study-photos-stay-online-after-you-delete-them/

Which intrigued me to look into how content management sites are handling deleted content.

Twitter

http://www.cio.com/article/print/493009

“However, by using Twitter’s Advanced search facility, all posts (whether they have been deleted or not) can be found, meaning that thousands of Twitter users can still get hold of Ross’s personal email address.”

Social networking sites in general

http://www.bbc.co.uk/blogs/technology/2009/05/your_photos_stuck_in_the_cloud.html

Every site served the test image given knowledge of its URL except for Windows Lives Spaces, whose photo servers required session cookies (a refreshing congratulations to Microsoft for beating the competition in security). We ran our initial study for 30 days, and posted the results below. A dismal 5 of the 16 sites failed to revoke photos after 30 days:

Facebook

Here is a picture of my dog from facebook. All of my privacy settings are set to friends only,

my dog

I wonder if it is because the privacy setting is only for “Photos tagged of You” not “Photos you upload” (see my settings below).

Even better, is that on albums where the Privacy setting is set to “Only Friends” they provide a link for public access. If you go to the link you can see the images, even if you are not a friend.

The moral of the story is only upload pictures of your pets or other images you don’t mind the world seeing!

Polls

April23

How Is My Site?

View Results

Loading ... Loading …
« Older Entries