Access database locally
Hi everyone.. I have a problem so i hope someone will help me solve it..
i work on c# windows application. the application has to have database.. access database, and oleDB.. and everything is great.. i can read from database, write in it.. run queryes (commandType = text, or store procedure) but there is one more thing i cah't acomplish.. the aplication should run on more than one computer (in local network) and shere same database.. something like (store, and magacin)
So can it be done with access database or it must be done with sql one?? it is realy importand to be access database, the aplication doesn't have special needs, something access can't do..
if there is way this be done please shere with me..
some basic examples of read and write would be great..
and conection string allso..
would i have to make something like server or what??
thanks and i hope there is solution with access so i wont need to use sql..
Kirtan PatelPosted Oct 24, 2009, 7:19 AM
it is Possible if you host your Access database on Web Server and Implement a Web service there which will Retrieve the Data and Send Back to the Requester which is your WinForm Application .
and Friend, Check "do you like this answer" i seen you are not doing so and Continue extending the thread even
after your actual problem when you started thread is solved you still not checked "Do you like this answer" so
please do that :)
Kirtan PatelPosted Oct 24, 2009, 8:28 AM
Aleksandar IlioskiPosted Oct 24, 2009, 7:46 AM
Aleksandar IlioskiPosted Oct 24, 2009, 7:45 AM
Aleksandar IlioskiPosted Oct 24, 2009, 7:02 AM
Kirtan PatelPosted Oct 19, 2009, 6:21 AM
using System.IO;
private void Form1_Load(object sender, EventArgs e)
{
FileSystemWatcher fsw = new FileSystemWatcher(@"E:\", "*.mdb");
fsw.EnableRaisingEvents = true;
fsw.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Attributes;
fsw.Changed += new FileSystemEventHandler(fsw_Changed);
}
public void fsw_Changed(Object Sender, FileSystemEventArgs e)
{
if (e.Name == "database.mdb")
{
// Code to Refresh The Data in Application
MessageBox.Show("File Changed !!");
}
}Master BillaPosted Oct 18, 2009, 8:52 PM
To this you can use the SystemFilewatcher class to detect
here is sample code
http://vinothnat.blogspot.com/2009/03/filesystemwatcher-in-c.html
thank you
Aleksandar IlioskiPosted Oct 18, 2009, 7:31 PM
Kirtan PatelPosted Oct 18, 2009, 5:23 PM
when access database is on Local Computer We Directly Writes path
like
C:\DatabaseFolder\database1.mdb
and When its in shared Drive we have to Write
\\SharedFolder\\database1.mdb
thats the diffrence no more diffrence in Connection String
Aleksandar IlioskiPosted Oct 18, 2009, 5:12 PM
Kirtan PatelPosted Oct 18, 2009, 4:59 PM
Aleksandar IlioskiPosted Oct 18, 2009, 4:56 PM
Kirtan PatelPosted Oct 18, 2009, 4:45 PM
No Connection string is not just Difference between Access and SQL server
Access uses Oledb Connections While SQL Server Uses ODBC >> SqlClient >>SQLConnection
Here are Examples Various Versions of Access Connection String
http://www.connectionstrings.com/access
Here are Examples of Various versions of SQL Server Connection String
http://www.connectionstrings.com/sql-server-2005
and
Finally Here is Guide How to Map Drive
http://support.microsoft.com/kb/308582
and you have to just replace the Shard path in Connection string i shown in Above Post dont include '< ' '>' in connection string :)
and please check "do you like this answer" please :)
Aleksandar IlioskiPosted Oct 18, 2009, 4:37 PM
Roei BarPosted Oct 18, 2009, 4:25 PM
a few things, about Access DB - its possible to have multi users on single DB you will need to create a shared drive place the MDB on that shared folder and have all users to have access to it via not UNC "\\
now about multi connection i could recommend you to use either SQL express which can hold around 200 users or SQLLight, for more users then that you can always use MySQL or SQL Server Standard and above
Kirtan PatelPosted Oct 18, 2009, 4:01 PM
shared in LAN
while sql Server database can be accessible by more then thousand users also :)
Better to Use SQL Server Database ..if Users are more then 10-15.
if application is for just stand alone one user then Access is Better Solution
but when multi users comes in picture sql Server is better .
more ever SQl Server Provides many other features like Stored Procedures , Triggers etc Program ability :)
Connection String for Access Shared Database
use Username and password only if you have set username password else remove those User Id password attributes :)
if my answer helped you don't forget to check "do you like this answer"
Aleksandar IlioskiPosted Oct 18, 2009, 3:20 PM