if you have the Application and the DB in the same location just skip the path from the connectionstring leaving just the FileName (i.e. Provider=Microsoft.Jet.OLE
Main Topics
Browse All Topics1.) How I Can connect to an database without specifying the absolute path of data base file.
I need this because I have data base and exe file in folder c:/MyProgram, and this program will not work on other people's computers because maybe they will not hold program on the same address (for example c:/Programs/MyProgram... or so).
2.) Is it ok to use M. Access data base when I work with 50 000 records?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Personally, I prefer to use an INI file in which I store the path of the database. This would allow you to put it anywhere you like. At the start of the application you could check if the file exists and if it doesn't, pop up a file dialog screen asking the user to enter where the database is located.
If you use the TADOConnection then by setting the path in the connectionstring should solve it quite easily. Simply use:
ADOConnection1.ConnectionS
Now, using Access with 50.000 records should be okay. I've done worse. But it won't perform as fast. Using Oracle, InterBase or SQL Server would be faster. I do hope your system has a lot of memory, though. If you do a query that returns all those records, they will all be put in memory and if there's not enough memory the swapfile will be used. Not that this won't happen with other databases, though. But be aware that if you use large amounts of records then always try to keep your datasets as small as possible in some way.
Also be aware of transactions. Make sure they're committed or else again, memory problems...
I agree with Alex that you should retain the location of the MSAccess database between executions either in an INI file, XML config file, or in the Windows registry. If the path is not known, allow the user to select the path, starting with the application directory. Access can easily handle 50k rows.
If you have performance problems with your MSAccess database, look at the following as potential remedies:
* launch the JetComp.exe utility to repair and compact the database
* look at the queries you are executing. There are often too few or too many indexes.
* also make sure that you execute as many stored queries as possible, converting your dynamic SQL into MSAccess querydefs.
* replace your MSAccess database with an MSDE database, which mimics a SQL Server.
* do some query optimization
> retrieve only the columns you need
> look for inefficiencies in your WHERE clause
> look at your table join efficiencies
Business Accounts
Answer for Membership
by: UrosVidojevicPosted on 2004-09-20 at 06:07:04ID: 12101708
information:
I am using ADO.