database project questions

callumh27

Member
Joined
Oct 6, 2009
Messages
7
Programming Experience
Beginner
Hi

I am about to begin a project where multiple users located in different locations will need read and write access to a database. Crucially, they must be able to read from it, whilst it is being written to. And ideally, it could be written to by multiple users simultanously. Is this possible? If so what is the best way of doing it in VB? I do not have much experiance with VB and databases, however I am familiar with connecting simple access databases using oledb. It would be preferable to avoid ASP.

Thanks

Callum
 
It would be over the internet, however I have been advised this would be extremely difficult, so will probably use php instead :/ Although if it is possible in vb.net I would be interested.
 
Some databases support direct connections over HTTP but I don't think it's used all that much for security reasons. Generally speaking, if you want to connect a Windows app to a database on the internet then you'd use a web service. You could create the web service using ASP.NET, WCF or some non-.NET technology if you prefer. If it's .NET-based, the web service will access the database using standard ADO.NET.
 
what do you mean by a web service? and how would it work? would the application connect to a web service which would connect to a database on the host? and then would that send the data back to the app?
 
A web service is an application that sits on a web server, like a web site, but has no user interface, i.e. no pages. It simply has methods that you can call to pass data up to the web server or get data from the web server. There's a ton of information out there on web services because they are a very important category of software these days. Like I said, you can use .NET technologies (ASP.NET, WCF) or not. As I said in my previous post, a .NET web service would use standard ADO.NET to access the database, just like any other .NET app.
 
what do you mean by a web service? and how would it work? would the application connect to a web service which would connect to a database on the host? and then would that send the data back to the app?

The simplest way of describing a web service is to say "it is a web site intended to be used by a computer rather than a human"

A website like this lets you do something: post questions, post answers, etc
There is a "new topic" function, a "post reply" function, an "upload attachment" function

Web services also have functions, but they expose them an a strict way, described by XML. This means a tool like Visual Studio can connect to it, download and understand the XML and say "ah, this web service exposes 3 functions: NewTopic, PostReply, UploadAttachment"
It then generates a block of code for you that you use in your code:

VB.NET:
Dim wsclient as New BlahBlahWebServiceClient

wsclient.NewTopic("What is a web service?", "Hi guys, here is my question.. Blah Blah Blah")

Think of the client as like a web browser, except your code uses it instead of a human


The web service connects to the back end database. It hence restricts the things possible (compared to exposing your db to the internet which you would then have to lock down so random people cant hack in and delete all the data) to just 3 things: NewTopic, PostReply, UploadAttachment


The good thing about web services is that they use a common language to describe themselves. Someone can write a PERL or a java program to communicate with your service, so your app can be expanded to work on, say a PDA or mobile phone by writing a small client targeted to the device in use. If your web service booked holidays for example, then a door to door salesman could carry a smartphone with a java client in it, using your web service and booking holidays. This could be much better than using a web browser on a phone to connect to a web site, and render the pages, but as you can see the theory is the same:
human<->web browser <-html-> web site.
human<->dedicated webserviceclient <-xml-> webservice

It's jsut another way of distibuting an app, but a more controlled and usable one. Someone might even write a website that uses your web service, then you have:
human->browser->website->webservice


If youre going the web service route, do it using WCF
 
Back
Top