Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question regarding network use of an sdf database

Status
Not open for further replies.
Jul 19, 2005
5
0
0
US
I'm looking for advice on how to proceed from here. I have a bit of a background in VB6 - recently made the jump to VB2008 and would like to see what you would suggest be the best way to handle these questions.

The current program I am writing will eventually need to be deployed in an office environment, and will need to be accessed by 3-5 people (at points concurrently). In VB6 I used an Access database, however with my current program I have switched to an SQL Server 3.5 compact database file.

Question #1:
If I have a shared folder on our network (for the sake of this we will call it the "sharedwitheveryone" folder - would I simply place the .sdf file in that folder for everyone on the network to access?

Question #2:
Since I am developing the program off-site, how would I go about telling the program where to look for the database file? I have seen in the app.config file a line called connection string, and while looking at the line it appears that it has something to do with the eventual placement of the database file, but I"m a little too green to want to tinker with the settings there just yet.

Question #3:
If I need to back-up my data - is it simply a matter of making back-up copies of the .sdf file?

Question #4:
What else would you suggest that I keep in mind while developing this program based on it's eventual destination?

Any answers the questions above would be GREATLY appreciated!

Thank you in advance for your help!

Rich H
 
my question to you is... why bother with the compact edition? I mean, you can use SQL Express 2008 instead. The compact edition has some restrictions that can be difficult to deal with.

SQL Express is free. Simply download it and install it. You can easily use vb.net to connect to sql express. The way it would work is...

You install the database engine. This installs as a service so as long as the computer you are running the database on is powered on, any and all clients would be able to connect to it.

You can install SQL Express on a desktop, it does not need to be a server. It's best if this computer has lots of ram because SQL is a bit of a memory hog, but that's really to your benefit because it speeds up data access.

When your clients connect, they need to know the computer name or the computer's IP address. SQL Express usually connects through tcp/ip ports. This means you do not need to have a shared folder. If the computer running the database engine has a firewall running on it, you will need to configure it to allow the port that SQL Server uses (default is port 1433).

There are various ways to configure the client computers. Usually I create a small configuration file (simple ASCII file) to store the server name and usually the user name of the last user that connected.

Backups are simple. With SQL Standard, there is a SQL Agent that runs scheduled SQL jobs. SQL Express does not have this. Instead, you create a simple backup query and run it using SQLCMD. You schedule this with windows task scheduler.

SQL Compact was written specifically to run on hand-held computers where storage space is very expensive. To minimize install space, Microsoft removed a lot of functionality which makes dealing with this type of database much more difficult. Since this is not a concern for desktops (where hard drive space is cheap), you really shouldn't impose these restrictions if you don't need to.


-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top