Solved

Access 97 & VB5

Posted on 2000-04-10
32
173 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:neymeyer
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:neymeyer
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
---- 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 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Do I need the DCOM if it is running on NT 4.0?
0
 
LVL 14

Expert Comment

by:wsh2
Comment Utility
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
Comment Utility
Adjusted points from 30 to 50
0
 

Author Comment

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

Neymeyer
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now