Data provider or other service returned an E_FAIL status |
Author |
Message |
|
Posted : 2006-08-18 00:04:11 |
I'm writing a VB6 application that will access QuickBooks 2006 database. I'm using registered read/write QODBC driver and some of the tables are unaccessible while others can be accesses with no problem. For example, while trying to read [Item] table, I receive the following error: [Error #2147467259 Description: Data provider or other service returned an E_FAIL status.]. At the same time, I can access [ItemInventory] table just fine. I tried to use adUseClient as well as adUseServer type of cursor - though adUseServer type of cursor allows faster data access, I still cannot get to the data table. Can anyone tell me what this is all about and what can be done to correct this issue? |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2006-08-18 14:00:16 |
Try changing the ADO cursor type to:
Const adUseServer = 2 oRecordset.CursorLocation = adUseServer
And just in case you try switching everything to adUseServer, please be aware stored procedure calls like sp_tables only like adUseClient cursor types. The Item table is also a read only table. |
|
|
|
|
Posted : 2007-12-14 11:02:09 |
I get this (Data provider or other service returned an E_FAIL status. ) error on several books with following SQL statement: SELECT BillPaymentCheck.TxnDate as Payment_Date, BillPaymentCheck.RefNumber as Check_Num, BillLinkedTxn.VendorRefFullName as Vendor_Name, BillLinkedTxn.TxnDate as Bill_Date, BillLinkedTxn.RefNumber as Bill_No, BillLinkedTxn.DueDate as Bill_Due_Date, BillLinkedTxn.AmountDue as Bill_Amount_Due, BillPaymentCheck.Amount as Amount_Paid FROM BillLinkedTxn, BillPaymentCheck WHERE BillLinkedTxn.LinkedTxnTxnID = BillPaymentCheck.TxnID AND (((BillLinkedTxn.TxnDate)>={d '2007-01-01'} And (BillLinkedTxn.TxnDate)<={d '2008-12-31'})) AND BillLinkedTxn.IsPaid = 1 objQBRecordSet.CursorLocation = adUseClient ' adUseServer 'objQBDataCon.Open "DSN=" & DatabaseName & ";OLE DB Services=-2;" objQBRecordSet.Open ReportCommandText, objQBDataCon, adOpenStatic, adLockOptimistic When I use adUseServer the recordset abruptly terminates after retrieving a few records. What should I do to fix this error please? Thank you, Piyush |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-12-14 11:21:16 |
Try this combination:
Const adOpenStatic = 3 Const adLockOptimistic = 3 Const adUseClient = 3
oRecordset.CursorType = 2 oRecordset.LockType = 3 oRecordset.CursorLocation = adUseClient |
|
|
|
|
Posted : 2007-12-14 11:53:09 |
I tried it and did not help. The retrieval stopped after the same row. Piyush |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-12-14 12:25:55 |
Check the SQL Statement using VBDemo, and try:
SELECT BillPaymentCheck.TxnDate as Payment_Date, BillPaymentCheck.RefNumber as Check_Num, BillLinkedTxn.VendorRefFullName as Vendor_Name, BillLinkedTxn.TxnDate as Bill_Date, BillLinkedTxn.RefNumber as Bill_No, BillLinkedTxn.DueDate as Bill_Due_Date, BillLinkedTxn.AmountDue as Bill_Amount_Due, BillPaymentCheck.Amount as Amount_Paid FROM BillLinkedTxn NOSYNC, BillPaymentCheck NOSYNC WHERE BillLinkedTxn.LinkedTxnTxnID = BillPaymentCheck.TxnID AND (((BillLinkedTxn.TxnDate)>={d '2007-01-01'} And (BillLinkedTxn.TxnDate)<={d '2008-12-31'})) AND BillLinkedTxn.IsPaid = 1
also. |
|
|
|
|
Posted : 2007-12-18 06:26:26 |
No luck with NOSYNC attribute with my VB6 application. It still crashes.
I am using Microsoft ADO Version 2.8 library. Could that be a problem?. VB Demo 32 program brings all the rows correctly for all the books. Piyush |
|
|
|
|
Posted : 2007-12-19 07:58:53 |
Hi Tom,
Since the VB Demo 32 program fetches all the Vendor payment details flawlessly, where do I get the source code for that program please?
I will replace MS-ADO with whatever data access mechanism that program is using.
Thank you very much,
Piyush |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-12-19 08:08:43 |
|
|
|
|
Posted : 2008-02-26 06:30:38 |
I am using following where clause to retrieve amount paid values for vendor bills:
BillLinkedTxn.LinkedTxnTxnID = BillPaymentCheck.TxnID
I am using .Net's System.Data.Odbc namespace to access the QODBC data.
I have realized that LinkedTxnTxnID is not a Jumpin columns. It may not be indexed. Is that the reason for the query giving E_FAIL status and slow performance? Most of the results are under 700 rows.
Thanks,
Piyush |
|
|
|