?
Solved

VB, ODBC, SQL '3669' Error??

Posted on 1998-10-20
9
Medium Priority
?
837 Views
Last Modified: 2013-12-25
Using VB 5.0, DAO 3.5, Using ODBC to SQL 6.5, Running a query against a view on the server.  I get a "3669 Execution Canceled" when I do the OpenRecordset. I'm using dbOpenSnapshot. The SQL log reports "EXIT SQLExecDirect with return code -1 (SQL_ERROR)"  The weird thing is it works a couple of times, but mostly not?!?!  Help!
0
Comment
Question by:ekim
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 1

Expert Comment

by:CarlosJac
ID: 1497086
Can you show me the code and the SQL log file contents ?
How many rows have the query results ?
Is this a long running query ?

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1497087
The error is either Out of Memory or Server timeout. In both cases the query takes to much resources.
0
 
LVL 14

Expert Comment

by:waty
ID: 1497088
When I do recordset, I never use snapshot. I alway use Dynaset,
try use the following DB access :

Set record = DB.OpenRecordset(sSQL, dao.dbOpenDynaset, dao.dbReadOnly + dao.dbSQLPassThrough)

I never have any problem
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:CarlosJac
ID: 1497089
If the problem is query timeout, you can resolve it using the QueryTimeout property of Connection or Database objects.
This property sets or returns a value that specifies the number of seconds to wait before a timeout error occurs when a query is executed on an ODBC data source.
Example:

dbsCurrent.QueryTimeout = 0    'wait forever

where dbsCurrent is the database object.



0
 

Expert Comment

by:mnord
ID: 1497090
The answer that you are looking for has been provided by CarlosJac.  However, the comment that was added to that line of code was incorrect.  QUeryTimeOut = 0 does not mean "wait forever" .....rather it means return immediately.  I was not aware that SQL Server has the same problem.  This is a problem with Oracle especially after doing several transactions and record updates and deletions in the same workspace.
0
 
LVL 1

Expert Comment

by:CarlosJac
ID: 1497091
ekim:

The querytimeout has resolved your problem ?
sorry, my english is bad ...


0
 
LVL 2

Expert Comment

by:mkmccreary
ID: 1497092
When this happens, what are you asking for?  If you ask for too many records, you are probably going to timeout.  If you are pulling back more than a 100 records at a time, you may need to re-examine your design.  Now, if you are searching across a large number of records, but pulling back small answer sets, then you may want to trap for the timeout error.  If the user says they want to continue, do nothing till the next check to the user.  If the user says no, then cancel the query on the server.

I'm making assumptions, with a little more information, I may be able to help.

Good Luck,
Martin
0
 
LVL 2

Accepted Solution

by:
majed100598 earned 2000 total points
ID: 1497093
try to use db object , make indexes on fields you quering
0
 

Author Comment

by:ekim
ID: 1497094
The error was a combination of many circumstances.  We indexed some more fields, we rewrote the view to provide a smaller recordset, we used dbReadOnly, but found using dbDynaSet and dbSQLPasthrough aggravated the problem with the JET engine locking up the cient workstation as it tried to process 10-20,000 records locally.  In the end we rewrote the program to make individual queries and combine the recordset later...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question