473,769 Members | 3,305 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ExecuteNonQuery : Error Cannot open action query ''

I am using VB.NET 2005 and MS Access.
I use OLEDbCommand ExecuteNonQuery to delete a record from a database.
Whenever the program gets a message, it creates a new thread to process that
message.
In the thread I open the database, then process the message.
Sometimes I get an error "Error Cannot open action query ''". Why can it
execute the query and how to fix it ?
Thank you.

Public Class Best
Dim clsEachMessage As New EachMessage

EachMessageThre ad = New Threading.Threa d(AddressOf
clsEachMessage. ProcessMessage)
:

Public Class EachMessage
Dim adoConOLE As OleDb.OleDbConn ection = Nothing
Private m_cmd As OleDb.OleDbComm and

Public Sub ProcessMessage( )
adoConOLE = New OleDb.OleDbConn ection
With adoConOLE
.ConnectionStri ng = g_dbPath
.Open()
End With

m_cmd = New OleDb.OleDbComm and
With m_cmd
.Connection = adoConOLE
.CommandText = sSQL
End With
m_cmd.ExecuteNo nQuery() --Error Cannot open action query ''
Oct 10 '07 #1
2 3735
Hi,

Do you have in the other thread altready a OleDB connection open?
Close that than first,

Cor
Oct 10 '07 #2
I open the connection in the beginning of each thread. And at the end of
each thread, I close the connection.
So you think the error "Error Cannot open action query ''" is because the
maximum connection has been reached ?

Thanks.

"Cor Ligthert[MVP]" <no************ @planet.nlwrote in message
news:3A******** *************** ***********@mic rosoft.com...
Hi,

Do you have in the other thread altready a OleDB connection open?
Close that than first,

Cor

Oct 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3028
by: Steve Jorgensen | last post by:
When writing VB or VBA code that works with databases or other external libraries that cannot be trusted to automatically do the right thing when references to their objects are arbitrarily released, some thought must be put into how to make sure the objects will all be closed and released in the correct order, even in the result of an error. This requirement can make our code really ugly, even following the best of commonly known best...
4
6506
by: MDW | last post by:
Hey all. I'm confused. I'm trying to add a single record into an Access 2000 database using ASP.Net. Here is the code: objConn = New OleDbConnection(strConnect) objConn.Open objCommand = New OleDbCommand("INSERT INTO LOGIN_MASTER (LOGIN_ID, PWD, F_NAME, L_NAME, TYPE_ID) VALUES ('" & strEmail & "','" & strPwd & "','" &
1
8584
by: DaveS | last post by:
Hi! I originally posted this in the dotnet.framework.adonet, but I'm not sure that was the right place. Anyway... I am exeuting an INSERT query from within a public function. Is there any way to know if the entire INSERT query completed updating in the database? It appears that code continues to execute even before the query has
3
35511
by: Richard Hollenbeck | last post by:
I've marked the line in this subroutine where I've been getting this error. It may be something stupid but I've been staring at this error trying to fix it for over an hour. I'm pretty sure the table and field names and controls are all named correctly, and the control referred to in the errant code is open, and it has data in it. Private Sub cmdAddIngredientToRecipe_Click() ' Get RecipeID for future action query Dim recipeID As Long
22
4328
by: b_r | last post by:
Hi, I'm trying to make a simple operation (insert into DB) in VB 2005 and SQL Server. The code is as follows: Dim sConnectionString As String = _ "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DB.mdf....
5
1527
by: Matt | last post by:
Hi all, I'm trying to use the following code in an application: // retrieve the connection string string strDbcx = Globals.strDbcx; // create the connection OleDbConnection dbcx = new OleDbConnection(strDbcx); // open the connection dbcx.Open();
1
3555
by: Jim | last post by:
I'm trying to take the data from strSQL below and "append / insert" that into the Access database. The problem is: although the listbox displays correctly, the Access table gets the first record inserted to the table multiple times - as many rows as there are in the source table. Obviously the Access parameters aren't getting updated properly. I've tried putting the .parameters.Add outside the for - next loop. No joy. Also, if...
8
4586
by: Tony M | last post by:
Shouldn't the ExecuteNonQuery be TRUE if it finds a record and FALSE is not? I get FALSE all the time and I seeded the database with the email address. I just want to check if record exist before moving on. If this doesn't work I guess I could load a datatable and check to see if rows 0. Dim cnString As OleDbConnection cnString = New OleDbConnection("Provider=MicroSoft.Jet.OLEDB.4.0; Data
7
4362
jinalpatel
by: jinalpatel | last post by:
I have a report which is based on a macro. Macro is serieas of open queries and a single open report query. When I run this report from my switchboard form it gives me the following series of errors. First it says "Please wait a moment while queries are run. The report will open automatically.Click ok to continue. When I hit "OK", there appears an "Action Failed" dialogue box, which has only one activated button called "Halt", which says the...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.