Hi,
I'm trying to access Quickbooks from via a SQLServer Query,
I'm using the OPENROWSET call and this works the first time I use it then fails the second and subsequent times for about 5 mins with the message below - then it works again - it's as if something it timing out and closing the origional connection thus allowing the SQL to execute again.:
2007-05-31 18:35:41 QODBC Ver: 7.00.00.214 ********************************************************************************************************************* IsAService: False Thread Change Begin Session Failed. S0000 00000 [QODBC] QB Begin Session Failed. Error = 8004041c, An internal QuickBooks error occurred while trying to access the QuickBooks company data file.
I'm not using a linked server.
Here is my SQL:
Select * From OPENROWSET('MSDASQL', 'Driver={QODBC Driver for QuickBooks}; DFQ=[Fully qualified QB File name on local workstation]; OpenMode=M; OptimiserOn=N; OLE DB Services=-2;', 'Select * From invoiceline UNOPTIMIZED WHERE (InvoiceLineAmount IS NOT NULL) AND (Subtotal <> 0) AND (RefNumber = ''[ref No]')');
Any Ideas please?
Dave Henderson |