ASP.NET, optimizer and Optimizer is turned off error |
Author |
Message |
|
Posted : 2008-04-29 06:22:53 |
I am trying to connect using ASP.NET. I set up all the permission on all the DCOM servers. If the optimizer is turned on, then my connection just hangs. Once I turn off the optimizer, i can connect and query the data with no problem.
I then have to insert checks. I insert into CheckExpenseLine first and then into Check. According to examples I have seen here I am setting FQSaveToCache equal to 1 during the insert. WHen I do this I am getting an error back: System.Runtime.InteropServices.COMException: [QODBC] Optimizer is turned off
If I omit FQSaveToCache or I set it equal to 0 it just hangs |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-04-29 08:15:24 |
ASP.NET runs queries as multiple treads, and the QODBC optimizer is single user only. So you need to setup a different optimizer file for the ASP.NET application to use than the other disktop applications. To do this, set up a seperate System DSN (see: How do I create or configure a QODBC DSN? ) and specify a fixed location of the optimizer database folder for the ASP.NET application to use (like: C:\Program Files\QODBC Driver for QuickBooks) instead of the default %UserProfile% method. Finally the user or system account used (Anonymous web user IUSR_machinename, ASPNET user and INTERACTIVE) by the ASP.NET application must all have full rights to the optimizer folder.
See also: ASP.NET vs Classic ASP |
|
|
|
|
Posted : 2008-04-29 08:36:19 |
when I turn the optimizer back on my app hangs when trying to open the connection. But when I use the DisplaySql.asp page it works fine. I saw the thread about ASP.NET and classic ASP and I put the AspCompat="True" in the page directive, but it made no difference.
I don't mind not using the optimizer. Shouldn't I be able to do the inserts with the optimizer turned off and not get the error: Optimizer is turned off? |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-04-29 09:18:15 |
Again, you still have a permissions issue with the optimizer folder. If the optimizer is off, then "Optimize data after an Insert or Update" must be also unchecked. |
|
|
|
|
Posted : 2008-04-29 09:42:20 |
That did it thanks.
I was under the assumption that once I turned off the optimizer it ignored all other setting on that page since they become disabled. |
|
|
|
|
Posted : 2008-05-02 06:18:28 |
Now I want to turn on the optimizer.
I created a seperate DSN and optimizer folder for my ASP app.
which users do I have to give permissions to the folder so that my connection won't hang? Currently it only doesn't hang if I turn off the optimizer.
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-05-02 07:34:52 |
The anonymous web user IUSR_machinename, ASPNET user and INTERACTIVE must all have full rights to the optimizer folder. |
|
|
|