on 07-28-2016 8:56 AM
Hello, all
I am having the strangest issue with SaveAs(PDF!, true) function for data store.
When application is run normally, in the user session, the function works correctly.
However, when the application is launched in batch mode from SQL Anywhere DB server (using xp_cmdshell command) it returns -1.
What am I missing here ?
Thank you
Arcady
My guess would be permissions, the SQL Anywhere DB will be running as a specific user and may not have permission to either run ghostscript or the folders where you are trying to save the PDF.
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just spoke with my tech support. They say that a windows service runs in a different environment and actually cannot see the printers. So you will have to create a user for this service and run it as that. So your using a domain user login is the only fix, just need to create a restricted user for this purpose.
It sounds like you probably already have this sorted, but I had a similar problem in Windows Server 2012 where it created a PDF, but it was 0 bytes. To fix it I had to add a few registry entries to make the Ghostscript PDF printer visible to the SYSTEM account. The registry entries were under :
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\
(Devices, PrinterPorts and Windows keys)
As David says below, my problem was because the SYSTEM account ran in an environment where the printers weren't visible. Adding the registry entries made them visible to the SYSTEM account.
Edit - Here is the knowledge base article that helped me (although my problem was not related to COM): https://support.microsoft.com/en-au/kb/184291
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.