473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ADO teething problems


I'm trying to make the crossover to ADO and I've stumbled into a
strange quirk in A2K (mdb, no linked tables).

I have a function which generates an INSERT query on the fly and runs
it.
DAO: CurrentDB.Execute StrSQL - works fine
DoCmd.RunSql StrSQL - works

But with ADO using cn.execute, I get Error -2147217833
"The field is too small to accept the amount of data you attempted to
add. Try inserting or pasting less data."

....which leads me to think that ADO treats field size/ type conflicts
differently to DAO / Straight Jet SQL queries.

Any takers?

Jul 24 '06 #1
5 3420
BillCo wrote:
I'm trying to make the crossover to ADO and I've stumbled into a
strange quirk in A2K (mdb, no linked tables).

I have a function which generates an INSERT query on the fly and runs
it.
DAO: CurrentDB.Execute StrSQL - works fine
DoCmd.RunSql StrSQL - works

But with ADO using cn.execute, I get Error -2147217833
"The field is too small to accept the amount of data you attempted to
add. Try inserting or pasting less data."

...which leads me to think that ADO treats field size/ type conflicts
differently to DAO / Straight Jet SQL queries.

Any takers?
My mind is too big to accept the amount of data you attempted to add.
Try inserting or pasting more data ... like the SQL of the Insert Query.

Jul 24 '06 #2

Lyle Fairfield wrote:
My mind is too big to accept the amount of data you attempted to add.
Try inserting or pasting more data ... like the SQL of the Insert Query.
Must be too much travel. According to Elvis Costello "They say that
travel broadens the mind till you can't get your head out the door."
So, have you been traveling recently?

j/k!

Jul 24 '06 #3

Lyle Fairfield wrote:
My mind is too big to accept the amount of data you attempted to add.
Try inserting or pasting more data ... like the SQL of the Insert Query.
As you wish - although i dont think it will help much. It's one of many
dynamically generated queries based on a set of transalation tables for
transforming data for import into differently shapped database. The
generated SQL works in ADO for other seed values - so it's just really
a case of finding the offending field for this case and trimmimg the
size.
- the confusion is how DAO runs it fine, DoCmd.RunSQL has no problems
and Access query runs it fine. What is ADO's problem?!?

INSERT INTO [COUNTERPARTY]
(
VALID_ON,
STATUS,
LOT_TYPE_FK,
IDE_COUNTERPARTY_REF,
IDE_INTERNAL_PARTY_REF,
IDE_SOURCESYS_REF,
IDE_SWIFT_BIC,
CDE_ECONOMICAL_SECTOR,
CDE_INTERNAL_SECTOR,
CTY_RESIDENCE,
CTY_NATIONALITY,
DES_ADDRESS,
DES_CITY,
DES_LONGNAME,
DES_SHORTNAME,
DES_POSTALCODE,
TYP_CLIENT_STATUS,
TYP_CPTY_TYPE
)
SELECT
[GLOB_CUSTOMER].[VALID_ON],
"0" AS [Constant_2],
"1" AS [Constant_3],
[GLOB_CUSTOMER].[CUSTOMER_NO],
"100010" AS [Constant_5],
"GLOBUS" AS [Constant_6],
[GLOB_CUSTOMER].[BIC],
[MAP_ECONOMICAL_SECTOR].[FIREField],
[GLOB_CUSTOMER].[SECTOR],
[GLOB_CUSTOMER].[RESIDENCE],
[GLOB_CUSTOMER].[NATIONALITY],
[GLOB_CUSTOMER].[STREET],
[GLOB_CUSTOMER].[TOWN_COUNTRY],
[GLOB_CUSTOMER].[SHORT_NAME],
[GLOB_CUSTOMER].[MNEMONIC],
[GLOB_CUSTOMER].[POST_CODE],
"2" AS [Constant_17],
[MAP_CPTY_TYPE].[FIREField]
FROM ((
GLOB_CUSTOMER
LEFT JOIN MAP_ECONOMICAL_SECTOR ON [GLOB_CUSTOMER].[SECTOR] =
[MAP_ECONOMICAL_SECTOR].[GLOBUSField])
LEFT JOIN MAP_CPTY_TYPE ON [GLOB_CUSTOMER].[SECTOR] =
[MAP_CPTY_TYPE].[GLOBUSField]);

Jul 25 '06 #4
I agree that nothing jumps out at you here.

I would be suspicious of "100010" and IDE_INTERNAL_PARTY_REF.

If IDE_INTERNAL_PARTY_REF is an integer field (not long integer) it can
hold a max value of 32767.

If one tries to insert a numeric value greater than 32767, say 32768
or 100010 into an integer field in DAO with CurrentDB.Execute StrSQL
DAO inserts the record but leaves the ineteger field Null.
DAO will fail however if we use
CurrentDB.Execute StrSQL, dbFailOnError

But in ADO the INSERT fails; the record is not INSERTED or APPENDED,
TTBOMK, always. I think ADO is superior in this respect.

My guess is that ADO isn't different in dealing with field sizes, but
that DAO is failing to report and break on an error.

But it's just a guess.

Jul 25 '06 #5
I found more coding is required with ado,

What works for me is:


im cmd As ADODB.Command

cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT * FROM myTable" '/* or any select statement or string variable
cmd.Execute

Set cmd = Nothing

See how that works.

Al
Jul 25 '06 #6

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

Similar topics

0
by: Jerome Lefebvre | last post by:
Hello, Hope this will interest a few. I been working with a friend on the problems given out during the "International Collegiate Programming Contest" (ICPC) http://icpc.baylor.edu/icpc/ ....
14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
1
by: 3f | last post by:
Hello; We have made a web application that people can download from our web site and installed on: Windows XP Windows 2000 Professional Windows 2003 Server Windows 2000 Server
5
by: Corky | last post by:
This works: db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID = PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
0
by: Sergistm | last post by:
Hello World, :D I have a problem that it is making me crazy, I hope you can help me. I'm trying to execute a .exe file with the Procces.Start, and there is no problem when the file is on my...
22
by: Ted | last post by:
This page http://homepage.ntlworld.com/r.a.mccartney/test/utf-8_test_file_hacked_for_ie_with_local_dtd.xml doesn't work properly in Firefox or IE6. The faults are different. In Firefox the...
7
by: greg | last post by:
Thomas Philips wrote: Have a look in /Library/Frameworks/Python.framework/Versions/2.5 You can't -- this feature only exists in the Search window, which is a different kind of window...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...

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.