473,809 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADO Execute or command execute?

Hi there

The below code executes some queries.
As newbie I was wondering weather you are better of using connection execute
or command execute to execute queries?

I am asking as Gcnndoh.Execute "AppendDataEntr ySummaryLevel2" causes a
Run-time error '-2147217900 (80040e14).
If I execute the query from the query editor it's working ok!! No
messages!!!
"*****code snipple********
Set Gcnndoh = CurrentProject. Connection
'append missing data entered "=Queryname s"
Gcnndoh.Execute "CreateTempdata check"
Gcnndoh.Execute "AppendDataEntr ySummaryLevel1"
Gcnndoh.Execute "AppendDataEntr ySummaryLevel2"
DoEvents

Gcnndoh.Close
set Gcnndoh = nothing

any suggestions are much appreciated.

Norman


Nov 12 '05 #1
2 1987
While I don't immediately recognize this error number, I'm going to guess
that your query has some references which can be resolved in the Query
Editor, but not by ADO. For example, if you reference a control on a form
directly in the query, ADO won't be able to resolve that reference.
It won't make a bit of difference whether you use connection or command
execute.

If you'd like to post the SQL of "AppendDataEntr ySummaryLevel2" , perhaps we
can make further suggestions.

BTW, are you working in an ADP, or an MDB? Is your back end data in Access?

HTH
- Turtle

"Norman Fritag" <mu*****@ozemai l.com.au> wrote in message
news:gq******** *********@nnrp1 .ozemail.com.au ...
Hi there

The below code executes some queries.
As newbie I was wondering weather you are better of using connection execute or command execute to execute queries?

I am asking as Gcnndoh.Execute "AppendDataEntr ySummaryLevel2" causes a
Run-time error '-2147217900 (80040e14).
If I execute the query from the query editor it's working ok!! No
messages!!!
"*****code snipple********
Set Gcnndoh = CurrentProject. Connection
'append missing data entered "=Queryname s"
Gcnndoh.Execute "CreateTempdata check"
Gcnndoh.Execute "AppendDataEntr ySummaryLevel1"
Gcnndoh.Execute "AppendDataEntr ySummaryLevel2"
DoEvents

Gcnndoh.Close
set Gcnndoh = nothing

any suggestions are much appreciated.

Norman

Nov 12 '05 #2
Turtle,
thanks for your reply!
I am working in Mdb, the backend data is in access.
Here is the error message and the sql of "AppendDataEntr ySummaryLevel2:
I am getting the following error message:
Run-time error '-2147217900 (80040e14)':
Invalid SQL statement;
expected 'DELETE', 'INSERT', 'PROCEDURE','SE LECT',
or 'UPDATE'.

Below is the sqlstatement, which causes this error when call by ado:
'************** *************** *****
INSERT INTO TblEntrySummary Level2 ( Dohid, [School Name],
SumOfTotNumberS tudentsIMMUNISE D, [Date Entered], Ok, [Area
Health Service] )
SELECT TblSCHOOLS.DOHI D, TblSCHOOLS.[School Name], Sum
(TblDataEntrySt ep2.TotNumberSt udentsIMMUNISED ) AS
TotNumberStuden tsIMMUNISED, TblDataEntrySte p2.[Date
Entered], 0 AS OK, TblSCHOOLS.[Area Health Service]
FROM TblSCHOOLS INNER JOIN TblDataEntrySte p2 ON
TblSCHOOLS.DOHI D = TblDataEntrySte p2.DOHID
GROUP BY TblSCHOOLS.DOHI D, TblSCHOOLS.[School Name],
TblDataEntrySte p2.[Date Entered], 0, TblSCHOOLS.[Area
Health Service];

I hope that asists.

regards Norman

"MacDermott " <ma********@nos pam.com> wrote in message
news:Z7******** *******@newsrea d3.news.atl.ear thlink.net...
While I don't immediately recognize this error number, I'm going to guess
that your query has some references which can be resolved in the Query
Editor, but not by ADO. For example, if you reference a control on a form
directly in the query, ADO won't be able to resolve that reference.
It won't make a bit of difference whether you use connection or command
execute.

If you'd like to post the SQL of "AppendDataEntr ySummaryLevel2" , perhaps we can make further suggestions.

BTW, are you working in an ADP, or an MDB? Is your back end data in Access?
HTH
- Turtle

"Norman Fritag" <mu*****@ozemai l.com.au> wrote in message
news:gq******** *********@nnrp1 .ozemail.com.au ...
Hi there

The below code executes some queries.
As newbie I was wondering weather you are better of using connection

execute
or command execute to execute queries?

I am asking as Gcnndoh.Execute "AppendDataEntr ySummaryLevel2" causes a
Run-time error '-2147217900 (80040e14).
If I execute the query from the query editor it's working ok!! No
messages!!!
"*****code snipple********
Set Gcnndoh = CurrentProject. Connection
'append missing data entered "=Queryname s"
Gcnndoh.Execute "CreateTempdata check"
Gcnndoh.Execute "AppendDataEntr ySummaryLevel1"
Gcnndoh.Execute "AppendDataEntr ySummaryLevel2"
DoEvents

Gcnndoh.Close
set Gcnndoh = nothing

any suggestions are much appreciated.

Norman


Nov 12 '05 #3

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

Similar topics

2
4574
by: michaaal | last post by:
I feel a bit silly asking this because I use this code all the time, but what does the ",,129" mean? Are there other parameters that one might use (I only do fairly simple SQL commands). conn.execute strSQL,,129
4
9900
by: Kartik | last post by:
Hi, I have an ASP.NET application using VB.NET.I am sending a DOS command to a machine on the network to print a file. This is achieved using xp_cmdshell Dim str As String = "xp_cmdshell ""type " & nwkfilepath & " > " & pPrinterName & " """
3
8017
by: Me | last post by:
hi, I have this file I need to execute from an ASP client. since we have installed it on the SQL Database server machine, I thought I could run it like this: Set Cn = CreateObject("ADODB.Connection") Cn.CursorLocation = adUseClient Cn.ConnectionTimeout = 0
1
8918
by: Matt | last post by:
I used to execute a command line script in IIS 4 using Dynuexec. This is a third part server object I installed on the server (http://www.dynu.com/dynuexec.asp). I installed this object onto my Windows 2003 Server and I cannot run the script from an ASP. No error is generated on the screen or in the event log. I think this has something to do with IIS not being able to access cmd.exe from IIS or maybe with COM permissions? Not sure though....
5
12423
by: Gustavo Randich | last post by:
Hello, I'm writing an automatic SQL parser and translator from Informix to DB2. Now I'm faced with one of the most difficult things to translate, the "foreach execute procedure" functionality provided by Informix. This is the problem: the execution of the translated SQL leaves the rows in the temp table correctly but raises error SQL0480N. It's very simple to try it: ------------
2
7626
by: Norman Fritag | last post by:
Hi there The below code executes some queries. As newbie I was wondering weather you are better of using connection execute or command execute to execute queries? I am asking as Gcnndoh.Execute "AppendDataEntrySummaryLevel2" causes a Run-time error '-2147217900 (80040e14). If I execute the query from the query editor it's working ok!! No messages!!!
4
7883
by: Chris | last post by:
I posted this in the C# language group, then thought it might be more appropriate in this group. I would not cross-post except I want the answer so badly. I built small C# Web and Web Service applications in a training class last week. The applications worked in the class, but when I tried to run them again over the weekend, they both bombed. Instead of getting my Web page, or the Web Service page, I get a page full of error text...
2
4501
by: Wei Wang | last post by:
Hi, I want to do a select in dynamic command, something like: TRIGGER FUNCTION DECLARE table_name_suffix text; temp_result RECORD; temp_result2 RECORD;
4
6761
by: alberto | last post by:
How can I execute a command of the operating system like "cls" from a C# code? Thank you
6
4443
by: Oliver | last post by:
I'm fairly new to DB2. I have been assigned to build a delete trigger that finds the data type of each of the table's fields so that the trigger can then build a string consisting of OLD values pre-wrapped in quote marks as needed. The deleted record's field values, all strung together as a single string, would then be inserted into a single archiving table (an architecture I inherited and cannot change). I've got the trigger doing...
0
9721
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
9601
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
10635
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...
1
10378
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7653
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
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
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
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.