Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
Asp.Net QODBC connection problems |
Author |
Message |
Rob |
|
Group | : Members |
Posts | : 4 |
Joined | : 2007-10-05 |
|
Profile |
|
Posted : 2008-05-13 14:15:10 |
QODBC version 8 QB Pro 2006
I have a very simple test app that I can't get to connect. Very simple C#.net web application. A connection is never made, and a timeout is never returned. The qbcust.asp demo works great. The TestDCOM.asp demo works fine. No errors. The VBDemo application also works fine.
But I can't get the simplest asp.net page to connect to QB. Here's the code:
namespace QodbcTest { public partial class test : System.Web.UI.Page { protected override void OnLoad( EventArgs e ) { System.Configuration.ConnectionStringSettings conStrSetting = System.Configuration.ConfigurationManager.ConnectionStrings[ "connStr" ]; OdbcConnection conn = null;
string connStr = conStrSetting.ConnectionString;
try { conn = new OdbcConnection( connStr ); conn.ConnectionTimeout = 15; conn.Open(); outputLbl.Text += "<br />opened!"; } catch( Exception ex ) { outputLbl.Text = ex.Message;
if( ex.InnerException != null ) outputLbl.Text += ex.InnerException.Message; } finally { if( conn != null ) { conn.Close(); conn.Dispose(); } } }
The connection string in the web.config is also very simple... <connectionStrings> <add name="connStr" connectionString="DSN=Quickbooks Data;OLE DB Services=-2;" /> </connectionStrings>
Any ideas? I've run through all the steps in How can I see QuickBooks data in a Internet Explorer Browser using Windows XP? and After upgrading to QuickBooks 2006 or 2007, QODBC "auto-login" unattended mode no longer works?
The qbcust.asp page works fine even with QB not running. Any ideas? Why don't I get a timeout? |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-05-13 16:16:46 |
The reason there's no timeout is because there's a permissions problem with the ASPNET user account, so QODBC doesn't even get to timeout. Normally we give read and write rights to the QuickBooks application folder (normally C:\Program Files\QODBC Driver for QuickBooks\) to the Anonymous web user IUSR_machinename, ASPNET user and INTERACTIVE. This allows access to the DCOM server executables.
By the sounds of things IUSR_machinename has the right permissions because qbcust.asp is working. |
|
|
|
Rob |
|
Group | : Members |
Posts | : 4 |
Joined | : 2007-10-05 |
|
Profile |
|
Posted : 2008-05-13 21:52:48 |
Well, since this is a domain controller running Exchange server, there is no ASPNET user. All the app pools are running under the NETWORK SERVICE user account. The directory does have permissions for IIS_WPG, IUSR_Machinename, NETWORK SERVICE, and INTERACTIVE.
When my web app starts up, I do see the qbXMLRP2eQODBCInteractive process get started. But still no connection. Suggestions? |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-05-14 07:09:00 |
The QODBC processes tends to run under the permissions of the user who logged onto the server and started QuickBooks. It is that users optomizer files that get used, regardless of who loggs onto IIS and becomes the AUTHENTICATED USERS.
Try logging in locally using the Admin account instead of Domain Admin. |
|
|
|
Rob |
|
Group | : Members |
Posts | : 4 |
Joined | : 2007-10-05 |
|
Profile |
|
Posted : 2008-05-14 07:34:51 |
Well, Quickbooks isn't running. The unattended mode works fine for ASP web applications. I log into the server as the administrator, and have full permissions to the C:\QODBC Driver for QuickBooks and C:\Program Files\QODBC Driver for QuickBooks
directories. I'm not sure what you mean by log into IIS.... this is not even an authenticated page I'm using for testing. I added Everyone to the permissions for those folders and gave them full access, still doesn't connect to QB.
Suggestions? I'm really at a loss here... |
|
|
|
|