Solved

VB, ODBC, SQL '3669' Error??

Posted on 1998-10-20
9
796 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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

867 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

18 Experts available now in Live!

Get 1:1 Help Now