473,797 Members | 3,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Different type conversion A2k and A97 ?

Hi all,
I have a database that I need to use in different versions of Access.
This is A97 in most places and A2k in a few other locations.
(I develop in A97 and convert the db to A2k for these other locations)
FYI: I am using A97 as backend for both versions. No problem.

After conversion A97 > A2k everything (seems to) work(s) just fine, except for one thing I only discovered today.
Using an unbound form to collect data that is used in an appendquery A2k fails with the appendquery.
It always worked and still works in A97.
Btw: In this example I am using a local table to append to.

Problem seems to be that Access does not understand the values in the unbound form.
Access complains about type conversion errors.
When I look at the query in design view and switch the view to the records to be appended I see strange characters like = in the datagrid.
Solution:
When I change the query and add parameters for *each field* in the form it works as expected.
But having to add parameters for all the fields (27) is very annoying...
Also: I am aftraid I have to check all these query's now ... Aarrrrrgggghhhh .

Any comments? No corruption here AFAIK.

Thanks,
Arno R

Dec 13 '05 #1
10 1680
> When I change the query and add parameters for *each field* in the form it
works
Yes
But having to add parameters for all the fields (27) is very annoying...
Yes
Also: I am aftraid I have to check all these query's now ...
Aarrrrrgggghhhh .


Yes

< Any comments? No corruption here AFAIK.

Sometimes even adding parameter types isn't enough. Fortunately,
we already had parameter types for most of our parameter queries,
and for the few cases where it failed anyway and crashed A2000,
we were able to code work-arounds.

(david)

"Arno R" <ar***********@ tiscali.nl> wrote in message
news:43******** **************@ text.nova.plane t.nl...
Hi all,
I have a database that I need to use in different versions of Access.
This is A97 in most places and A2k in a few other locations.
(I develop in A97 and convert the db to A2k for these other locations)
FYI: I am using A97 as backend for both versions. No problem.

After conversion A97 > A2k everything (seems to) work(s) just fine, except
for one thing I only discovered today.
Using an unbound form to collect data that is used in an appendquery A2k
fails with the appendquery.
It always worked and still works in A97.
Btw: In this example I am using a local table to append to.

Problem seems to be that Access does not understand the values in the
unbound form.
Access complains about type conversion errors.
When I look at the query in design view and switch the view to the records
to be appended I see strange characters like = in the datagrid.
Solution:
When I change the query and add parameters for *each field* in the form it
works as expected.
But having to add parameters for all the fields (27) is very annoying...
Also: I am aftraid I have to check all these query's now ...
Aarrrrrgggghhhh .

Any comments? No corruption here AFAIK.

Thanks,
Arno R
Dec 14 '05 #2

"david epsom dot com dot au" <david@epsomdot comdotau> schreef in bericht news:43******** *************** @lon-reader.news.tel stra.net...
Sometimes even adding parameter types isn't enough. Fortunately,
we already had parameter types for most of our parameter queries,
and for the few cases where it failed anyway and crashed A2000,
we were able to code work-arounds.

(david)



Thanks David,

I Googled around for this problem and saw a tip on Allen Browne's site about setting the format property for unbound controls.
But no luck with this also. In my example Access 'want's' a parameter setting for all fields.
I did read that there is a difference between Jet 3.6 and Jet 4.xxx in this 'type guessing' issue.

Do you happen to know whether this 'problem' is 'solved' in A2002 or A2003?

Arno R
Dec 14 '05 #3

Arno R wrote:
Problem seems to be that Access does not understand the values in the unbound form.
Access complains about type conversion errors.
When I look at the query in design view and switch the view to the records to be appended I see strange characters like = in the datagrid.
It woud be helpful if we knew how Access is being asked to "understand "
the values in the unbound form and when and what types of values. A few
lines of code could show this?
Any comments? No corruption here AFAIK.


All data on form are strings, series of bytes. Access magically or
wickedly, depending upon the situation and your point of view, may
treat these as someting else: numbers, booleans, blobs whatever.
As Access and VBA progress they seem to merge more of their
functionality with unicode. This can cause some things we have designed
to self-destruct. Where our work expected one byte previously it is now
getting two.
This may have nothing to do with your problem whatever, of course,

More information would help me to understand.

Dec 14 '05 #4

"Lyle Fairfield" <ly***********@ aim.com> schreef in bericht news:11******** *************@g 47g2000cwa.goog legroups.com...

Arno R wrote:
Problem seems to be that Access does not understand the values in the unbound form.
Access complains about type conversion errors.
When I look at the query in design view and switch the view to the records to be appended I see strange characters like = in the datagrid.


It woud be helpful if we knew how Access is being asked to "understand "
the values in the unbound form and when and what types of values. A few
lines of code could show this?
Any comments? No corruption here AFAIK.


All data on form are strings, series of bytes. Access magically or
wickedly, depending upon the situation and your point of view, may
treat these as someting else: numbers, booleans, blobs whatever.
As Access and VBA progress they seem to merge more of their
functionality with unicode. This can cause some things we have designed
to self-destruct. Where our work expected one byte previously it is now
getting two.
This may have nothing to do with your problem whatever, of course,

More information would help me to understand.


Hi Lyle,
This is about an order form for shoes... (from one shop to another).

As I said I use an unbound form (FrmKlantenBest elling) to collect orders.

I use the values from this form in an appendquery like:
INSERT INTO TabKlantBestell ing ( Besteld, WinkelVan, WinkelNaar, Categorie, Artikelnummer, 0, 35, [35+], 36, [36+], 37, [37+], 38, [38+], 39, [39+], 40, [40+], 41, [41+], 42, [42+], 43, [43+], 44, [44+], 45, [45+], 46, [46+] )
SELECT Date() AS Mutatiedatum, [Forms]![FrmKlantenBeste lling]![VanWinkel] AS VWinkel, [Forms]![FrmKlantenBeste lling]![NaarWinkel] AS NWinkel, [Forms]![FrmKlantenBeste lling]![Categorie] AS Cat, [Forms]![FrmKlantenBeste lling]![Artikelnummer] AS Art, [Forms]![FrmKlantenBeste lling]![0] AS 0, [Forms]![FrmKlantenBeste lling]![35] AS 35, [Forms]![FrmKlantenBeste lling]![35+] AS [35+], [Forms]![FrmKlantenBeste lling]![36] AS 36, [Forms]![FrmKlantenBeste lling]![36+] AS [36+], [Forms]![FrmKlantenBeste lling]![37] AS 37, [Forms]![FrmKlantenBeste lling]![37+] AS [37+], [Forms]![FrmKlantenBeste lling]![38] AS 38, (this goes further ..... until 46+)

I have combo's to select Categorie, Artikelnummer, ShopTo and ShopFrom and controls for the values 35, 35+, 36, 36+ .......46, 46+ (these values mean the size of the shoes, numbers from 1 to 5 are entered in the fields)

With Acces97 this worked for years without any problem.
After conversion (I had to convert the app for other reasons) to A2K, it does not work like this ONLY if I add the types (parameters) in the query like:

PARAMETERS [Forms]![FrmKlantenBeste lling]![VanWinkel] Text ( 255 ), [Forms]![FrmKlantenBeste lling]![NaarWinkel] Text ( 255 ), [Forms]![FrmKlantenBeste lling]![Categorie] Short, [Forms]![FrmKlantenBeste lling]![Artikelnummer] Long, [Forms]![FrmKlantenBeste lling]![0] Short, [Forms]![FrmKlantenBeste lling]![35] Short, [Forms]![FrmKlantenBeste lling]![35+] Short, [Forms]![FrmKlantenBeste lling]![36] Short, [Forms]![FrmKlantenBeste lling]![36+] Short, [Forms]![FrmKlantenBeste lling]![37] Short, [Forms]![FrmKlantenBeste lling]![37+] Short, [Forms]![FrmKlantenBeste lling]![38] Short, ....... ;
INSERT INTO TabKlantBestell ing ( Besteld, WinkelVan, WinkelNaar, Categorie, Artikelnummer, 0, 35, [35+], 36, [36+], 37, [37+], 38, [38+], 39, [39+], 40, [40+], 41, [41+], 42, [42+], 43, [43+], 44, [44+], 45, [45+], 46, [46+] )
SELECT Date() AS Mutatiedatum, [Forms]![FrmKlantenBeste lling]![VanWinkel] AS VWinkel, [Forms]![FrmKlantenBeste lling]![NaarWinkel] AS NWinkel, [Forms]![FrmKlantenBeste lling]![Categorie] AS Cat, [Forms]![FrmKlantenBeste lling]![Artikelnummer] AS Art, [Forms]![FrmKlantenBeste lling]![0] AS 0, [Forms]![FrmKlantenBeste lling]![35] AS 35, [Forms]![FrmKlantenBeste lling]![35+] AS [35+], [Forms]![FrmKlantenBeste lling]![36] AS 36, [Forms]![FrmKlantenBeste lling]![36+] AS [36+], [Forms]![FrmKlantenBeste lling]![37] AS 37, [Forms]![FrmKlantenBeste lling]![37+] AS [37+], [Forms]![FrmKlantenBeste lling]![38] AS 38, [Forms]![FrmKlantenBeste lling]![38+] AS [38+], [Forms]![FrmKlantenBeste lling]![39] AS 39, [Forms]![FrmKlantenBeste lling]![39+] AS [39+], [Forms]![FrmKlantenBeste lling]![40] AS 40, [Forms]![FrmKlantenBeste lling]![40+] AS [40+], [Forms]![FrmKlantenBeste lling]![41] AS 41, [Forms]![FrmKlantenBeste lling]![41+] AS [41+], [Forms]![FrmKlantenBeste lling]![42] AS 42, [Forms]![FrmKlantenBeste lling]![42+] AS [42+], [Forms]![FrmKlantenBeste lling]![43] AS 43, [Forms]![FrmKlantenBeste lling]![43+] AS [43+], [Forms]![FrmKlantenBeste lling]![44] AS 44, [Forms]![FrmKlantenBeste lling]![44+] AS [44+], [Forms]![FrmKlantenBeste lling]![45] AS 45, [Forms]![FrmKlantenBeste lling]![45+] AS [45+], [Forms]![FrmKlantenBeste lling]![46] AS 46, [Forms]![FrmKlantenBeste lling]![46+] AS [46+];

Also when I set the format property of the numeric controls to standard (as Allen Brown suggests in one of his tips) it does not work.

Hope this makes sense and makes it clear to you.

Arno R
..

Dec 14 '05 #5
Thank you Arno.
The table and query are interesting.
I think it's not unusual to have to tell JET what type of data it is
getting; you seem to have found a way to do it satisfactorily; some
think it's a good idea always to use a collection of typed parameters.
Perhaps, you have had occasion to think about the advisability of
naming fields with names that might be mistaken for numbers? Sometimes
JET SQL can refer to fields by their ordinal position; at this time it
might be confused between a field named "1" and the first field. Also
it may be confused about a literal 1 and the field name 1.

Dec 14 '05 #6

"Lyle Fairfield" <ly***********@ aim.com> schreef in bericht news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Thank you Arno.
The table and query are interesting.
I think it's not unusual to have to tell JET what type of data it is
getting; you seem to have found a way to do it satisfactorily; some
think it's a good idea always to use a collection of typed parameters.
Perhaps, you have had occasion to think about the advisability of
naming fields with names that might be mistaken for numbers? Sometimes
JET SQL can refer to fields by their ordinal position; at this time it
might be confused between a field named "1" and the first field. Also
it may be confused about a literal 1 and the field name 1.


Hi Lyle,
Yes, I know about the field names ... they are 'horrible'.
It is a database I 'inherited' and sort of 'took over' from another guy.
Once in production it is very hard to change the tabledefinition s and/or fieldnames.
These fieldnames are also used in a *lot* of queries of course.
You get what I mean? But what the heck... it works for years and years.
I would develop it somewhat different that's for sure.

Access 'understands' that 35 is a field when this is put between brackets like [35].
But the fieldnames is not the problem at all here ...
I need to work with two versions of this app now because of install problems I had.
The problem is the difference in behaviour between an app developed in A97 and the very same app converted to A2k.

I noticed the difference in the type recognition when developing new apps in A2k, but I managed to find and solve these cases by testing and testing.
This app is fully tested and in production for years now, but when it's converted gives problems suddenly.
I tested the converted app, but obviously not enough....

Arno R
Dec 14 '05 #7
>Do you happen to know whether this 'problem' is 'solved' in A2002 or A2003?

Sorry, no idea. (It's the kind of thing you fix, and then don't
change back to try again.)

I always avoid form references like that, The main reason I have form
references in complex queries is because other people write them.

And our other parameters were all declared and typed in the conversion
from A2.0 to A97 because of similar problems with A97!

BTW, I also had to change one of my combo boxes so that it's base
query was not "DISTINCT". Sometimes grouping (and Union Queries)
seem to mess up the type information, and sometimes seem to mess
up the .Value of combo boxes.

(david)

"Arno R" <ar***********@ tiscali.nl> wrote in message
news:43******** **************@ text.nova.plane t.nl...

"david epsom dot com dot au" <david@epsomdot comdotau> schreef in bericht
news:43******** *************** @lon-reader.news.tel stra.net...
Sometimes even adding parameter types isn't enough. Fortunately,
we already had parameter types for most of our parameter queries,
and for the few cases where it failed anyway and crashed A2000,
we were able to code work-arounds.

(david)

Thanks David,

I Googled around for this problem and saw a tip on Allen Browne's site about
setting the format property for unbound controls.
But no luck with this also. In my example Access 'want's' a parameter
setting for all fields.
I did read that there is a difference between Jet 3.6 and Jet 4.xxx in this
'type guessing' issue.

Do you happen to know whether this 'problem' is 'solved' in A2002 or A2003?

Arno R
Dec 14 '05 #8
Arno

The problem is that Access97 permits this very sloppy sql script.
That problem was 'solved' in Access 2000 and, I suspect, JET4.0.

This guessing, this type coercion, prevents VBA (and JET SQL to the
extent that it emulates VBA) from being fast and efficient. To many
advanced programmers it makes VBA, Access and even JET objects of
derision.

If one wants to write sound code one types all variables and explicitly
converts them when conversion is required, leaving nothing to Uncle
Bill to guess at. This is the difference between a man and a milk sop.
Oh no, sorry that's India Pale Ale, isn't it? Oh well, you get the
idea.

Dec 14 '05 #9
david epsom dot com dot au wrote:
I always avoid form references like that, The main reason I have form
references in complex queries is because other people write them.


That's good advice. I run in an environment that is similar to Arno's.
I use unbound forms for search, select and edit since only one person
updates, say, customer or vendor information. I rarely use a form
reference in SQL for those cases. I build the SQL string in code
behind the unbound form and have the string include conversion
functions when needed. I'm glad Arno pointed out the problem though.

James A. Fortune
CD********@Fort uneJames.com

Dec 15 '05 #10

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

Similar topics

8
1545
by: nl | last post by:
Hello, I've got a question... I'm currently coding a software rasterizer... I actually like to write my own matrix/vector classes, which I did, but those classes don't work on the D3DX library of DirectX functions which I also like to use... These only accept D3DXMATRIX, D3DXVECTOR2/3/4 etc classes... Using casting, is there any way to cast forward and backward from my own classes to and from the microsoft d3dx classes? I'm thinking...
10
2277
by: Niels Dekker (no reply address) | last post by:
Is it possible for a standard compliant C++ compiler to have ( sizeof(short) < sizeof(int) ) and ( sizeof(short) == sizeof((short)0 + (short)0) ) ? Regards, Niels Dekker http://www.xs4all.nl/~nd/dekkerware
9
5068
by: Mikhail Teterin | last post by:
Hello! I'd like to have a variable of a pointer-to-function type. The two possible values are of type (*)(FILE *) and (*)(void *). For example: getter = straight ? fgetc : gzgetc; nextchar = getter(file); What type should I give to `getter' so that the compiler does not issue
9
2441
by: CptDondo | last post by:
I am working on an embedded platform which has a block of battery-backed RAM. I need to store various types of data in this block of memory - for example, bitmapped data for control registers, strings for logging, and structures for data points. I want to use one function to read data from this block and one function to write data, for example: sram_read(OBJECT_IDENTIFIER) would return a pointer to the appriate object and
7
2243
by: Madhu Gopinathan | last post by:
Hi, I hope this is the right forum for this question. I am extending ICollection to create a Collection Type (say MyCollection) wherein I can control the types of objects being added to the collection. Thus, my interface now looks like this public interface IMyCollection : ICollection { void Add (string toBeAdded);
16
12801
by: Enekajmer | last post by:
Hi, 1 int main() 2 { 3 float a = 17.5; 4 printf("%d\n", a); 5 printf("%d\n", *(int *)&a); 6 return 0; 7 }
8
1621
by: ALiX | last post by:
Hi all, In my code I use different vectors of the same size to hold some data. At some point I need to iterate through all vectors at the same time. Now, the question is what type should the index variable have? size_t? vector<X>::size_type? vector<Y>::size_type? Example code: -------------------- vector<X> xv; vector<Y> yv;
20
2648
by: pinkfloydhomer | last post by:
Is it well-defined and portable to do something like: typedef struct { int type; char c; } S1; typedef struct {
1
2477
by: y2ktan | last post by:
Hi Ladies and Gentlements, I have a variable with the type of double. Let said that it is 0.003. double dblValue = 0.003 Now, when I want to convert it to string with the local regional language set to US English . The output value is 0.003
0
9685
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
10468
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
10245
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...
1
10205
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,...
0
10021
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
6802
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();...
1
4131
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
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.