|
-
Apr 4th, 2000, 11:34 PM
#1
Thread Starter
Member
I've got these 3 old VB 3.0 programs that our company is maintaining (but that's another story all together )
One of the apps refuses to compile, even though the code it is choking on, is exactly the same in all 3 apps. There is a variable declaration:
Global ds As Dynaset
Then in the code, a little something like this:
Code:
sql = "select count(*) from tempdb..mp_eac"
sql = sql & " where dat_ty_cd='S'"
Set ds = db.CreateDynaset(sql, 64)
sup_rec_count = ds(0)
When I go to run this app from the dev environment I get the following error, "Object is not an array". With the "ds" in the last line listed above highlighted.
I checked the code in the other programs and it is identical, any clues?
~Michael Kizer
http://Michael.Kizer.ws
The Ivory Gate Of Dreams ~ http://www.ivorygate.com
-
Apr 5th, 2000, 12:29 AM
#2
Lively Member
Are you saying that you compiled all three programs and only one of them does not work? The CreateDynaset is obsolete according to the MSDN. If you only tried to compile the one program and it is giving you the problem then it may be due to a newer version of DAO on the machine you are compiling from.
-
Apr 5th, 2000, 03:05 AM
#3
Thread Starter
Member
Yeah, I compiled all 3 of these apps on the same machine, with only one of them producing his error.
The thing is, I don't have time to rewrite these apps (all 3 created in VB 3.0 and are huge). Later this year, I'll be forcing the issue (again) of getting these apps ported to VB 6 as a major priority, until then it's all Band-Aids and chewing gum.
~Michael Kizer
http://Michael.Kizer.ws
The Ivory Gate Of Dreams ~ http://www.ivorygate.com
-
Apr 5th, 2000, 03:22 AM
#4
Thread Starter
Member
OK, found a work around!
Well, I did some more digging on the internet and found an answer to this problem. It seems that there is a bug in the VB parser that prevents certain usages of a globally declared table var in a form.
To fix this, I added a sub routine to the form that tried to access the "ds" variable as such (named this way to force it to be the first subroutine in the form):
Code:
Sub AAAA_FixDS ()
ds.MoveFirst
End Sub
This subroutine never gets called, but tricks the parser to go ahead and know that "ds" is indeed a table var.
Whew! ;-)
~Michael Kizer
http://Michael.Kizer.ws
The Ivory Gate Of Dreams ~ http://www.ivorygate.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|