Solved

DataControl recordsource Query Cancel

Posted on 2002-05-20
5
195 Views
Last Modified: 2010-05-03
I have :
- DataControl (Data1)
- I can search in a database file with the following code:

Data1.databasename="c:\Proj\Data.mdb"
Data1.recordsource="select * from MyTable where Field1 like '*computer*'
Data1.refresh

My Quez is:
 How to CANCEL that QUERY, for example by pressing ESC key.
PLZ I want a sample code
I Dont Know any thing about SQL SERVER, So dont use it

Thanks
0
Comment
Question by:khalid_Z
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 75 total points
ID: 7024138
Basically you can't, the data control is designed for simple data access and doesn't allow asynchronous queries. This means that from the point of issuing the query you cannot raise or handle any events within the VB application until it is complete. If you really have to do this then you should look at doing your data access through coding rather than using the controls in the toolbox. With coding you get much more flexibility and you may have the ability to issue a query as an asynchronous one which you CAN cancel if necessary.
0
 

Expert Comment

by:elzohry
ID: 7026061
PLZ give me an example, to access that issue with code
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7818310
Hi khalid_Z,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

khalid_Z, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7909770
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7910853
Seems we have 2 accounts.  If no response in 72 hours I will suspend both.  Post here which account you would like to keep

Computer101
E-E Admin
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
String manipulation in Visual Basic 7 73
Add and format columns in vb6 7 63
Powerpoint 2013: Change cell reference in excel link 3 80
Set WorkSheet  not Working 9 38
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…
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…
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…
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…

840 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