Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 97 & VB5

Posted on 2000-04-10
32
Medium Priority
?
185 Views
Last Modified: 2010-05-02
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?
0
Comment
Question by:neymeyer
  • 10
  • 7
  • 6
  • +3
32 Comments
 
LVL 2

Expert Comment

by:Crin
ID: 2701442
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
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2701453
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
0
 

Expert Comment

by:viveksarin
ID: 2701511
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:neymeyer
ID: 2701572
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??
0
 
LVL 2

Expert Comment

by:Crin
ID: 2701631
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

0
 

Author Comment

by:neymeyer
ID: 2701669
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?
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2701742
No, the declarations are all the same no matter what. I think you have something else going on than a bad install.

M
0
 
LVL 2

Expert Comment

by:Crin
ID: 2701776
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
0
 

Author Comment

by:neymeyer
ID: 2701780
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.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2701797
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
0
 

Author Comment

by:neymeyer
ID: 2701799
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.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2701813
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
0
 
LVL 2

Expert Comment

by:Crin
ID: 2701815
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 :)
0
 
LVL 2

Expert Comment

by:Crin
ID: 2701832
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


0
 

Author Comment

by:neymeyer
ID: 2701857
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.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2701864
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
0
 

Author Comment

by:neymeyer
ID: 2701866
would the MSFlexGrid cause any problems?  I do use some of those, but not directly with the database???
0
 
LVL 2

Expert Comment

by:Crin
ID: 2701915
Don't think so...
MSFlexGrid seems to work Ok

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

Sincerely yours,

Crin
0
 

Author Comment

by:neymeyer
ID: 2701938
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?
0
 
LVL 2

Expert Comment

by:Crin
ID: 2701954
---- OFFTOPIC ----

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

---- OFFTOPIC ----

0
 
LVL 14

Accepted Solution

by:
wsh2 earned 200 total points
ID: 2702438
Being a little more specific with Mark2150's very correct comment..
RUN MDAC_TYP.EXE on your client's machine!

In your setup.. make sure you include the MDAC_Typ.Exe file in the PDWizard redist directory.. (as per Mark2150, a FULL install setup).. or just copy it and run it on your client's machine. If you don't know where Mdac_Typ.exe is.. do a Start.. Find. If you still can't find it.. go to MSDN and download the latest MDAC versions and install them. My guess is that the client's Data Access Components are definitely out of synch with yours.. <smile>.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2702639
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
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2702857
mark2150..
<looking at my hand and then lap>.. You gotta Palm Visor?.. Gosh, I better get to work then!!!.. <lol> and a <wink>.
0
 
LVL 1

Expert Comment

by:barnacky
ID: 2704912
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.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2704949
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>.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2704963
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>.
0
 
LVL 1

Expert Comment

by:barnacky
ID: 2705548
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.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2706148
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>.
0
 

Author Comment

by:neymeyer
ID: 2708036
Do I need the DCOM if it is running on NT 4.0?
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2709665
No.. DCOM shipped with NT 4.0.. the main concern you might have is legacy Windows 95 machines.. that have very little software installed.
0
 

Author Comment

by:neymeyer
ID: 2727040
Adjusted points from 30 to 50
0
 

Author Comment

by:neymeyer
ID: 2727041
Thanks!!  I used the mdac and it works now.  I gave you some more points also.

Neymeyer
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question