Solved

VB, ODBC, SQL '3669' Error??

Posted on 1998-10-20
9
801 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 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