Link to home
Start Free TrialLog in
Avatar of neymeyer
neymeyer

asked on

Access 97 & VB5

I have a VB app that needs to be distributed to a machine without Access.  I know this is possible, but am getting run-time error 3265 - "item not found in this collection."  I don't really care about security on the database, I just want it to be accessable from my app.  Any suggestions?
Avatar of Crin
Crin

Hello neymeyer,

"item not found in this collection." usually means that programm try to access to unexisted field, for example...

Does this software works properly SOMEWHERE?

If not - this is the reason.
Then:
Run your application from VB shell and press "debug" when error occures.
Check spelling and fix it.


Sincerely yours,

Crin
You need to install using the Setup Wizard and build the installation kit. Then when you install on a clean system it'll run like a top. If you're just copying the .EXE around this will NOT work. If you've done that and you're still getting the error then you have a programming error and not an installation issue.

M
the matter of fact is that if you are using vB6.0 then in addin there is the option of deployment wizard go and create installable of your program and then try installing your program. also include your access database. i think it would work now.
Avatar of neymeyer

ASKER

The code works fine on the machine I coded it on, which has Access 97 on it, and I did create the setup program like mark2150 was talking about it.  There is no programming error to my knowledge unless the database, recordsets, etc need to be declared differently when Access is not installed??
Hello newmeyer,

Check if correct version of Microsoft DAO (you need 3.51 version) selected in Project->References.

Also try to locate exact line where trouble occures. To do it you can try to append call of shown DoDebug function after each line of the code.

public function DoDebug(Msg as String)
open "c:\myProg.txt" for append as #1
print #1, format(Now, "hh.mm.ss") & " - " & Msg
close #1
end function

Sincerely yours

Crin

I can't do the doDebug because it isn't my machine that is having the problem.  On my machine, where I developed the app, the program runs correctly.  I checked to be sure, and I am running the DAO 3.51 library.  I can't figure it out.  Thanks for your help, though.  Do you have any other suggestions?
No, the declarations are all the same no matter what. I think you have something else going on than a bad install.

M
Hmmm...
Are you sure the database on the user machine is same with yours(means TableDefs, QueryDefs etc names)?

Seems the problem is here...

As a suggestion: what other references are active in your project? If there are some databases oriented one try to declare recordset variables directly as DAO.Recordset... (don't believe myself :)))

By the way: why not to create debug version and ask costumer to send back log file? It really can help... Forgot: of course DoDebug must send different Msg each line :)))

Sincerely yours,

Crin
Mark2150,
Any ideas what could cause it to run fine on my machine, but not the other?  I checked on Microsoft's site, but they only listed a solution for Access 95.  The fix is not the same in Access 97.
Are you running the compiled version or are you running in the debug environment? If you have the error trapping turned off in the IDE then the error will go unnoticed but will occur in the production app.

M
Crin,
One thing I looked at was that for some reason I had the data bound grid selected, but not used.  Would that make a difference?  I have removed the component and reference.  I can try resending the executable to the client and find out how it works, unless you don't think it will change anything.
Before you send the .EXE out, rebuild the project's install kit and compare the SETUP.LST files from the original and the new and see what (if anything) changed.

M
Hmm...

It could be installation problem ONLY if you forgot to include some files to media and there are incompatible version of these files on the user's machine.

BUT in this case other types of errors occures usually. Here is the problem with array of controls or with database access. Controls array must produce error anywhere (for example me.optbuttonCase(5).value when there are only 4 optbuttonCase loaded).

As soon as your installation was prepared by wizard - it collect all references and build installation right way (of course EVERY code have own bugs - wizards also :)). But it seems to me that it is local and users databases incompatibility...

Sincerely yours,

Crin

PS. English is not my native language so don't hesistate to ask for more detailed explanations :)
Wow... you really need to send installation, not exe itself, at least now, in the future (when problem disappear) you can send exe only while there are no new references added.

Sincerely,

Crin


Good point...should send the installer

mark2150 - I must have deleted the old installer after I sent it out.  It won't be any problem to send a new one until the problem is resolved.
Yeah, I'd start out by sending a *FULL INSTALL* and rerunning from scratch. There is usually a STxUNST.LOG file created at install time in the same directory as the .EXE is in. Have the client send this to you to see what (if anything) was updated. It'll show you what .DLL's and such were loaded.

M
would the MSFlexGrid cause any problems?  I do use some of those, but not directly with the database???
Don't think so...
MSFlexGrid seems to work Ok

By the way, isn't it time to adjust more points? :)))))))

Sincerely yours,

Crin
I was going to give both of you like 100, but just haven't done it yet.  I assure you that you will get those for all the work you and mark2150 are doing to help me out.  Does that sound fair?
---- OFFTOPIC ----

I'm the very first time here, sorry if it is not in EE rules...  But sounds really fair... :)))

---- OFFTOPIC ----

ASKER CERTIFIED SOLUTION
Avatar of wsh2
wsh2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
neymeyer,

Don't worry about the points. I've already got 1/4 million of 'em, three T shirts and a Palm Visor. Just glad to help.

M
mark2150..
<looking at my hand and then lap>.. You gotta Palm Visor?.. Gosh, I better get to work then!!!.. <lol> and a <wink>.
Be very careful to choose the right version of mdac_typ.exe.  If all you have is VB5, then you should be okay.  When you run mdac_typ, make sure it displays the proper version.  You do not want to run mdac 2.1.
Adding to barnacky's comment:
If you are installing to a Windows 95 machine.. make sure it has DCOM installed or the MDAC components will not work.. <smile>.
Barnaby:
Question - what is with MDAC 2.1? I seem to recall reading somewhere it is buggy, can you elaborate? Also.. latest version of MDAC on MSDN is 2.5.. what are the differences?.. Thank YOU.. <smile>.
I'll try to elaborate.  MDAC has gone through a series of upgrades that include fixes, additions, and new providers for new databases.  I believe ADO 1.0 was Microsoft's first try and 1.5 followed.  However, ADO 2.0 was really the first version that people started using instead of DAO or RDO.

In terms of Access, ADO 2.0 included the OLE_DB Provider for Access 97.  As the Office 97 Service Packs were released, ADO 2.0 was updated concurrently.  When VB6 was released, (and Office 2000) ADO 2.1 was released.  ADO 2.1 contained the OLE_DB Provider for Access 2000.  This provider worked with Access 97 databases, but there were a few "glitches" since Access 2000's Jet engine was different than Access 97's Jet engine.

ADO 2.5 is the latest release.  It includes additions to ADO 2.1 to allow it to work better with web site development (XML), and it contains a provider for the Active Directory.  I'm sure there is more, but this is from the top of my head.

Finally, if you are using Access 97, I highly recommend you use ADO 2.0 based on my experience.  I never noticed a performance drop with ADO 2.1 and Access 97, but the Jet4.0 Provider doesn't support features such as replication with Access 97.

In addition, it doesn't hurt to install all the versions of ADO, JUST MAKE SURE YOU DO IT IN ORDER.  ADO 2.0, ADO 2.1, ADO 2.5.  If you need ADO 2.0 or 2.1, I have both, and I would be glad to email them to you.
Thank YOU for the MDAC comment Barnacky!!!.. I hope it helps the questioner.. <smile>.

Adding to Barnacky's comment again.. <groan>.. on the client machine, make sure they have DCOM installed.. or the MDAC installation will fail.. <sigh>. DCOM98.EXE is the latest version that I know of.. check your VB6 / Studio CD-Rom for a copy of it.. <smile>.
Do I need the DCOM if it is running on NT 4.0?
No.. DCOM shipped with NT 4.0.. the main concern you might have is legacy Windows 95 machines.. that have very little software installed.
Adjusted points from 30 to 50
Thanks!!  I used the mdac and it works now.  I gave you some more points also.

Neymeyer