Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all , 

I have created a winform application which is currently in my C drive(desktop) connected to access database which is also present in bin/debug of my winform source folder.

Now i want to 

publish this in a network drive where two users can open this form and enter data .

When i go to publish folder my database name is not showing in application files , hence i am not able to connect to it .

please help how to publish this application.

I have attached my app.config which i think might help you providing me a solution.
<pre lang="xml"> <?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="WindowsFormsApp1.Properties.Settings.TrialConnectionString"
            connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Trial.accdb"
            providerName="System.Data.OleDb" />
    </connectionStrings>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
    </startup>
</configuration>


What I have tried:

And also i don't have a setup project wizard , so i tried publishing by direct Project-publish-and publish wizard method
Posted
Updated 26-Jul-20 18:35pm

There are three problems here:
1) You really don't want to be using Access as a multiuser database. Yes, yes - you can ... but that doesn't mean it's a good idea. Every time I have, it's come back to bite me and caused some real problems. If you want a multiuser data base, use a server based system such as Sql Server or MySql - they are designed for it and it makes life so much easier.
2) The problem you have noticed is ... The data directory expects to be on the local machine: the computer running the app, not the computer holding app on the network drive. So unless you want to have each user with his own separate version of the DB (and that's generally a nightmare to manage once they start updating and inserting) you would need to put the DB in a folder that everybody can reach, probably via a mapped drive, and change the connection string to refer to that drive, folder, and file for each user computer.
3) You very, very definitely do not want the DB stored on your dev machine, and most certainly not in the dev folder: you go to make a change, you test it, and ... it empties the table. This messes up the other users and takes a while to sort out. Dev machines work on a copy of the production DB (or a copy with just test data / anonymised data (live data is a bad idea from a GDPR POV).

I'd strongly suggest looking at a central SqlServer installation with a separate one on your dev machine for testing instead of using Access at all.
 
Share this answer
 
You do NOT want the Access database as part of your deployment.

Why? Well, when you publish the next version of your app, the deployment will overwrite the database on your network drive, destroying the data that's already there.

Also, Access is TERRIBLE in a multi-user environment. It was originally designed and built as a "desktop", or single-user, database. Multi-user support was slapped on top of it. You WILL have problems, and you damn well better have backups of the database, preferably on a daily basis because every once in a while, you're going to need to restore it.

Scalability is also an issue. Sure, you have two users now, but it never stays that way. You will eventually outgrow Access, and a lot sooner than you expect.

Maintenance is also a pain in the ass. When you have to update the database, you cannot just copy the new database file over the top of the old one. You're going to do this accidentally and you're going to have to restore from backup. You did make backups every day, right? Also, when you do update the database, everyone using the app will have to exit the application before you can do so.
 
Share this answer
 
Thank you so much for your suggestions ..i am now creating a SQl database for the same.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900