Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Dear My Friends:
 
1. Is it neccesary to install Access on the target machine in a C# project with an Access DB?
 
2. If it is not neccesary to install Access, is it possible to change some fields of my access DB through my C# program?
 
(I made a windows application program that it has some Access DB. if I bring this program to another computer that has not installed Access , does the program work properly or not. please just tell me yes or no.)
 
SINCERELY
Posted 13-Jan-13 8:02am
Edited 13-Jan-13 8:21am
v3
Comments
David_Wimbley at 13-Jan-13 14:12pm
   
do you have an access database set up on a remote computer? Are you able to connect to it (no firewall issues)?
 
When you say change fields do you mean change values of the fields or change the schema? You can do both.
 
Your question is not very clear and does not lead to what your end goal is. Use the Improve Question widget to better define your requirements.
Mmohmmad at 13-Jan-13 14:15pm
   
I made a windows application program that it has some Access DB. if I bring this program to another computer that has not Access installed, does the program work properly or not. please just tell me yes or no.
David_Wimbley at 13-Jan-13 14:20pm
   
Simply installing your app that has a localized access database on your PC and not bringing the database along with it will not work.
 
You either need to deploy the app with the database in the project or host the access database on some other server/computer and point your connection strings to that database remotely. Ill submit some links as your solution to get you going.
Mmohmmad at 13-Jan-13 14:24pm
   
Dear David:
 
I deploy the app with the database in the project. I just want to know that if my target mashine does not have installed Access does my program work properly or not?
David_Wimbley at 13-Jan-13 14:30pm
   
is your app 32 or 64 bit? To my knowledge if its 64 bit you will have issues with access database as you will need to download 64bit access on the PC.
 
The jet engine is on the PC by default since windows 2000 i believe.
 
However depending on what version of access you are using and your target machine you may have issues.
David_Wimbley at 13-Jan-13 14:35pm
   
is your app 32 or 64 bit? To my knowledge if its 64 bit you will have issues with access database as you will need to download 64bit access on the PC.
 
The jet engine is on the PC by default since windows 2000 i believe.
 
However depending on what version of access you are using and your target machine you may have issues.
Mmohmmad at 13-Jan-13 14:51pm
   
thanks for your notes David. your answer arises some other questions.
1. does C# of VS@2010 solve the issue of 32 bit or 64bit?
I mean that if I make a windows application program with C# of VS2010 in my 32bit mashine does this program work properly when is installed in other 64bit PC?
David_Wimbley at 13-Jan-13 14:55pm
   
In theory yes, if your app is compiling to 32 bit you should be fine on a 64 bit machine, what matters is your target that you are compiling to. You may run into issues with file permissions or your connection string depending on where your database ends up on the targets PC
 
This screen shot has a view of where you would select 32/64. It would be the Platform Target that you would want to make sure is 32 bit.
 
http://i.stack.imgur.com/6OyyU.jpg
 
Mmohmmad at 13-Jan-13 15:17pm
   
thanks for the picture. I checked out the Build tap of properties of my project, however, in the GENERAL group I do not have an option of "prefer 32-bit" like in your picture, I use VS2010 ultimate. Does it make a sense?
David_Wimbley at 13-Jan-13 15:45pm
   
yea it makes sense, the prefer doesnt matter as long as your target build is 32 bit, only grabbed that picture as an example
Mmohmmad at 13-Jan-13 16:29pm
   
thanks for your simple and clear explanation. this problem of mine was solved. now I come back to my second question.
2. if I use access 2010 and VS2010 32-bit and deploy my database with the program, is it possible to have some problems in target PCs with version of windows upper than XP that donot have Access? (based on your notation it seems that I might encounter to some issues). so what should I do to solve the problem without need of installing Access 2010?
David_Wimbley at 13-Jan-13 16:40pm
   
You "may" have issues, the easier solution would be to host your access database on a server/remote PC instead of having to install it onto each individual PC that your app will end up going on.
 
Then all you would have to do is alter your connection string to use the hosted acces database IP/Hostname.
 
The only thing you may run into here is firewall/permissions issues but if those occur/once they are resolved it should be relatively smooth sailing with your app as far as connectivity to the DB is concerned.
 
With this method you also won't have to worry about permissions on each individual PC (providing you have little to no control over that).
Mmohmmad at 13-Jan-13 16:48pm
   
it is a nice solution. but unfortunately first of all, all of the users of the program do not access to internet and secondly, the nature of my program does not allow me to put my DB in a remote server. so what is your suggestion for this issue?
David_Wimbley at 13-Jan-13 17:02pm
   
Since that is the case your going to have to go with the recommendation i made in the solution below.
 
Your going to need to attach your mdb file to the setup project so that way when it deploys it will also take the database with it.
 
Then youll just have to make sure that the database goes into a folder that it has read/write access to. So maybe even creating your own folder so you can circumvent permissions issues that may be present.
Mmohmmad at 13-Jan-13 17:14pm
   
thanks. you are rock (someone who is as solid or steady as a rock is very strong and calm in difficult situations and you can depend on them). :) thanks aagain.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you are going to host the database on a server/pc and connect to it from your work station here are some links
 
http://www.c-sharpcorner.com/uploadfile/mimrantaj/connect-to-access-database-in-C-Sharp-and-ado-net/[^]
 
http://msdn.microsoft.com/en-us/library/5ybdbtte%28v=vs.71%29.aspx[^]
 
If your deploying your app with a local access database on the PC youll need to create an installer package and add the access database to it so when it installs it will add the access database as well. Youll need to right click on your setup project, select view and then file system. In there you can add the database to the setup project so it will be deployed with your app
 
Creating a setup project:
http://www.youtube.com/watch?v=Lcue0jo41AM[^]
 

More information on installers
http://msdn.microsoft.com/en-us/library/vstudio/2kt85ked%28v=vs.100%29.aspx[^]
  Permalink  

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

  Print Answers RSS
0 Schatak 394
1 OriginalGriff 330
2 _Amy 115
3 Andreas Gieriet 100
4 Rob Philpott 90
0 OriginalGriff 7,107
1 Sergey Alexandrovich Kryukov 5,623
2 Maciej Los 3,504
3 Peter Leow 3,373
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 13 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100