Reputation: 2445
I wrote a console application using Interop.QBFC13 that connects to Quickbooks. If I set up a scheduled task with "run only when user is logged in" it will open the console window and run successfully. If I set up the scheduled task with "run whether user is logged on or not" the task will run without opening the console window and I get the error "Could not start Quickbooks"
I read somewhere about not being able to run the QBFC SDK when there is no UI and I am wondering if that might be the problem since the console window doesn't open? If so, how would I run the console app with the "run whether user is logged in or not" setting?
Thanks!
Upvotes: 1
Views: 954
Reputation: 71
Make sure that SQL Server support is ticked inside the QODBC application.
Then run task scheduler as administrator by going to the location of the task scheduler.
Then go the task scheduler and click "Run Whether user is logged on or not", input the user details and run the task: this should give you an error
[RODBC] ERROR: state S0000, code 10075, message [QODBC] Server Edition of QODBC is required to use the DCOM Servers
Once this is done, change it back to "Run only when user is logged on", this should technically fix the problem.
Upvotes: 1
Reputation: 643
I believe I found the answer to the question-> not necessarily a solution to reach the goal.
QB and QBXML SDK applications have to run in the context of a user.You will have to have a Windows session open, but the user does not have to be logged in to QB for your application to run against it. However, QB will have to be opened by an admin the first time your application makes the connection and you authorize unattended mode.
Windows Scheduler has changed from Desktop base to Service based from Vista or Win7 onwards, and the new OS has the Scheduler as Service based.
QuickBooks and QODBC are desktop based application/driver.
QODBC uses QuickBooks SDK, and QuickBooks SDK uses QuickBooks Application to get data from company file.
QuickBooks SDK requires an active desktop session (someone to is logged in) to the machine because QuickBooks is a desktop-based application. If no one logged on the server/machine, you will get the error "Could not start QuickBooks".
Even if you have specified the username/password and have a user logged into the machine, you may notice the same error. This is because task executed from Task Scheduler runs as a different user / new session.
The workaround is to use a Desktop Based Scheduler like Z-Cron or http://alternativeto.net/software/task-scheduler/?platform=windows.
now this may not be the solution you want. but it does answer your question/problem and includes a workaround.
i am also facing the same dilemma and am looking for a solution. this may have to be the way i go. another option is to kick off your console application on any user login, and keep track of your last successful run, current application status (whether its currently running or not) - so you ensure you run within your specified schedule. but not only is it a relatively messy solution, you do not necessarily have a guarantee someone will login during your required time allotment (they may not even login in for a week).
i tried to kick off a remote session, which causes the app to run from startup, from another server using task scheduler. but that gave me the exact same result.
im currently looking into QBWC, to see if either of those approaches would allow me to achieve the desired goal of communication with QB on a scheduled bases autonomously.
i regret that I could not provide a definitive solution for you, but I think you and others can gain from the research ive already done so far. Additionally I hope this information helps you find the right solution.
Upvotes: 3