By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

Array

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.