Database deployment

Ash Audis

New member
Joined
Feb 19, 2012
Messages
3
Programming Experience
1-3
Hello, i'm creating an application that i would preferably like to gather information from a database, so others may add information to the database and extend the use of the application.

I first tried using an excel file as a back end database, which worked fine for what i needed, but found that trying to read an excel database through vb.net when the computer running the application didn't have excel installed, it would just cause errors.

I have since then tried an Access Database, which again works like a charm on my programing system, however once the application is transfered to a computer without Access installed, i run into problems again. I have gotten around this problem by installing a 25MB download from Microsoft that will install the required files to allow my application to work with Access Database files, however, i'd preferably like to not force the user to go download a 25MB download to make use of my Application.

Therefore i am wondering if anyone could suggest a way in which i could get either the excel database to work without excel installed, or access to work without access installed or downloading the 25mb download. I don't mind using a different file type as a database, and i'm happy looking up the information on how to read and write to such a database, but one in which near all computers would be able to use my application without extra downloads required.

Thanks in advance.
 
It is possible to work with both Excel files and Access files without having to install any additional software. That only applies to the "old" file formats though, i.e. XLS and MDB. If you want to use the "new" file formats, i.e. XLSX and ACCDB, then you will need to either have the appropriate Office application installed (2007 or later) or else you must install the Access Connectivity Engine (ACE), which is presumably the 25MB download you are talking about.

If you use the old formats then, in the connection string of your OleDbConnection, you specify the provider as Jet 4.0, which is installed standard with Windows. If you use the new formats then you specify the provider as ACE 12.0, which is part of Office and the Access Connectivity Engine. See ConnectionStrings.com for exact connection string formats.

If you are using ClickOnce publishing or a Setup project to create an installer for your app, it is possible to create a custom prerequisite package for ACE and then have it deployed automatically with your app, just as you can do with the .NET Framework, SQL Server Express and others.
 
Thank you very much, just the information i have been looking for, i struggled to Google the right term to find that sort of information! I will look in to working with the older file types. Thank you :nevreness:

/Ash Audis

P.S Sorry for being Vague in the first post, i wrote the post late last night after i'd been strugeling to find the right information for some time, stress and being tired didn't help.
 
Thanks for the suggestion cjard, it's most appreciated. I've decided to keep to Access with the old format .mdb

There is another problem i have ran in to, I'm reading data from my database, and pulling a name from the database and throwing it into a combo box. This loops to fill the combo box full of the database of names. This is working fine, however i would like to organize the combo box alphabetically.

How am i best doing this? I've thought of two possible ways, but not sure how i would go about them, or which is the better method of the two.

1. Somehow control the order of which the database is read, so the combo box fills in alphabetical order? Not sure if this is even possible. At the moment it seems to read in quite a random order??

2. Sort the combo box into alphabetical order after all the data is in there? How would i go about doing this in vb.net?

/Ash
 
First up, please keep each thread a single topic and each topic to a single thread. If you have a new topic to discuss then please start a new thread. Obviously populating a ComboBox in alphabetical order has nothing whatsoever to do with database deployment so this is a new topic.

Secondly, I'd suggest that you don't use a loop at all. Populate a DataTable, either by DataAdapter or DataReader, and bind that to the ComboBox.

Regardless of whether you bind or not, just add an ORDER BY clause to your query and then the data will come from the database already sorted.
 
Back
Top