Solved

VB, ODBC, SQL '3669' Error??

Posted on 1998-10-20
9
778 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
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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 1000 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now