Solved

VB, ODBC, SQL '3669' Error??

Posted on 1998-10-20
9
825 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

717 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