473,809 Members | 2,951 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 7625
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
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
1987
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
9600
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
10633
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
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10114
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...
1
7651
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
5548
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
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
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
2
3860
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.