473,322 Members | 1,690 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,322 software developers and data experts.

Array

I have an Access database that was designed with Office1995 version. It has
a Sub which has array in it and it doesn't seem working with MS Office 2002
XP version. The program is a bit long but basically it is like this:

(the following Sub is called by another Private Sub)

Sub Oletest(cnn as ADODB.Connection, ....)
Dim SqlQuery As String
Dim RcdSet As DAO.RecordSet
Dim ppArray() As Varian
ReDim ppArray(1 to 10, 1 to 2)
...

SqlQuery = "SELECT * FROM ..."
Set RcdSet = CurrentDb.OpenRecordSet(SqlQuery)
If statement ....
...
Do Until statement ...
...
ppArray(arrayVal,1) = RcdSet![tax_info_1]
...
Loop
End if
...
The database works with Office 1995 but not with Office 2002. And I don't
see anything wrong with the array statement (I suspect the problem may be in
those array statements). Anybody knows about it? Thanks. Appreciate it.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1

Nov 16 '06 #1
5 1441
On Thu, 16 Nov 2006 18:40:09 GMT, "ruomingxu via AccessMonster.com"
<u29180@uwewrote:

I'm sure you meant:
Dim ppArray() As Variant

There is nothing inherently wrong with this code, so my money is on
the query not returning what you are expecting.
The best way to find out is to set a breakpoint at the top of the
code, and carefully step through, inspecting values, etc. to ensure it
does what you want it to.

You never mentioned in which way "...it doesn't seem to be
working...". My chrystal ball didn't know either. Perhaps you could
post back with more details after the debug session.

-Tom.
>I have an Access database that was designed with Office1995 version. It has
a Sub which has array in it and it doesn't seem working with MS Office 2002
XP version. The program is a bit long but basically it is like this:

(the following Sub is called by another Private Sub)

Sub Oletest(cnn as ADODB.Connection, ....)
Dim SqlQuery As String
Dim RcdSet As DAO.RecordSet
Dim ppArray() As Varian
ReDim ppArray(1 to 10, 1 to 2)
..

SqlQuery = "SELECT * FROM ..."
Set RcdSet = CurrentDb.OpenRecordSet(SqlQuery)
If statement ....
...
Do Until statement ...
...
ppArray(arrayVal,1) = RcdSet![tax_info_1]
...
Loop
End if
..
The database works with Office 1995 but not with Office 2002. And I don't
see anything wrong with the array statement (I suspect the problem may be in
those array statements). Anybody knows about it? Thanks. Appreciate it.
Nov 16 '06 #2
ruomingxu via AccessMonster.com wrote:
The database works with Office 1995 but not with Office 2002.
Having made millions of mistakes I can think of millions of things "not
work" might mean. What does it mean in this case?

What is lurking in your code? It's a strange procedure indeed that
takes an ADODB connection as an argument/parameter and then opens a DAO
recordset.

Having made millions of mistakes I can think of millions of things "not
work" might mean. What does it mean in this case?

What is lurking in your code? It's a strange array indeed that is
redimmed at the beginning of a procedure, and the dimensions are, as
nearly as we can tell, constant.

Having made millions of mistakes I can think of millions of things "not
work" might mean. What does it mean in this case?

What about the first dimension, arrayval? How is its value determined?
How does the code ensure that it does not exceed the max dimensioned
value of the array?

Did I mention that it's very hard to answer a question about something
that doesn't work. My sister's cousin's husband's mother has a car that
doesn't work. Could you suggest what the problem is?

Access 95? Cool!

Nov 17 '06 #3
On 16 Nov 2006 19:15:53 -0800, "Lyle Fairfield" <ly***********@aim.comwrote:
>My sister's cousin's husband's mother has a car that
doesn't work
Wouldn't she be your cousin too?

Wayne Gillespie
Gosford NSW Australia
Nov 17 '06 #4
Wayne Gillespie wrote:
On 16 Nov 2006 19:15:53 -0800, "Lyle Fairfield" <ly***********@aim.comwrote:
My sister's cousin's husband's mother has a car that
doesn't work

Wouldn't she be your cousin too?
You think my sister's cousin married my cousin's son? I don't think so,
at least it never showed in the relationship window.

Nov 17 '06 #5
"Lyle Fairfield" <ly***********@aim.comwrote
>My sister's cousin's husband's mother has a car that
doesn't work

Wouldn't she be your cousin too?

You think my sister's cousin married my cousin's son? I don't think so,
at least it never showed in the relationship window.
Is your sister's cousin also your cousin, or are family relationships
figured differently where you come from?

Your sister's cousin's husband would be your sister's cousin-in-law,
wouldn't he? And his mother would be your sister's cousin-in-law once
removed? I'm not sure about your sister's relationship to her
cousin-in-law-once-removed's car, however.
Nov 17 '06 #6

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

Similar topics

2
by: Brian | last post by:
I'm diddlying with a script, and found some behavior I don't understand. Take this snippet: for ($i = 0; $i <= count($m); $i++) { array_shift($m); reset($m); }
2
by: Stormkid | last post by:
Hi Group I'm trying to figure out a way that I can take two (two dimensional) arrays and avShed and shed, and subtract the matching elements in shed from avShed I've pasted the arrays blow from a...
15
by: lawrence | last post by:
I wanted to test xml_parse_into_struct() so I took the example off of www.php.net and put this code up on a site: <?php $simple = <<<END <item>
8
by: vcardillo | last post by:
Hello all, Okay, I am having some troubles. What I am doing here is dealing with an employee hierarchy that is stored in an array. It looks like this: $employees = array( "user_id" => array(...
12
by: Sam Collett | last post by:
How do I remove an item with a specified value from an array? i.e. array values 1,2,2,5,7,12,15,21 remove 2 from array would return 1,5,7,12,15,21 (12 and 21 are NOT removed, duplicates are...
8
by: Mike S. Nowostawsky | last post by:
I tried using the "toUpperCase()" property to change the value of an array entity to uppercase BUT it tells me that the property is invalid. It seems that an array is not considered an object when...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
104
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from...
7
by: Jim Carlock | last post by:
Looking for suggestions on how to handle bad words that might get passed in through $_GET variables. My first thoughts included using str_replace() to strip out such content, but then one ends...
17
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hi Gurus, I need to transfer a jagged array of byte by reference to unmanaged function, The unmanaged code should changed the values of the array, and when the unmanaged function returns I need...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.