Distributing a multi-user application

Hi there,

This post stems from a problem that many of us are having: the fact that we don’t see our database being updated.

I understand now why this is the case as there have been many posts on the subject. We are expecting to see the database updated (in the Database explorer or in the Solution explorer) when in actual fact a local copy of the database (in the bin folder) is being updated (unitl you rebuild your app in which case it gets over written again).

My question is, if VB2005E works with a local copy of the database, how can I distribute the application to multiple users Will all the users have their own local database Can I not have a shared data source (SQL Server) on a shared drive and have multiple users access and update the database

Many thanks




Answer this question

Distributing a multi-user application

  • eax

    Hi Chris.... MS is selling a Product..... This is a Virtue... We the USA are Capitalists.... This is a Virtue to US(A).... Read Ayn Rand we the living Etc..... Most of the rest of the World are some form of Socialists..... This piece of Software is Probably the Best ever written on this Planet and is a Gift from MS.... Sure it's Challenged in Printing and Networking but so what.... See Above.... Cheers
  • Matt Scott -- MSFT

    One of the limitations (it is free afterall), is that within the IDE it is designed to only connect to and manage local data sources. If you want to develop multi-user applications, and want to manage things from within the IDE, then the recommendation would be to commit to purchasing Visual Studio 2005.

    However, it is possible to connect to any remote data storeage medium (aka. database) on the network, or even the internet, using VB Express. You could use the SQL Server Management Studio Express to design and build your database, and use VB to perform your data actions. The reason I prefer this method is that you dissasociate your coding from the data storage - the temptation to modify the data storage structure to suit the coding can have potentially devastating effects. For a local application this isn't a big deal at all, and will probably speed application development.

    Multiuser connectivity requires different strategy, since it's possible that many applications will connect to the database: the database structure needs to be arranged so that this is possible.

    Okay, now the code. You can do something like this to connect to a remote database:

    Dim conn As New SqlClient.SqlConnection
    conn.ConnectionString =
    "Server=THUNDERBIRD4\SQLEXPRESS;Integrated Security=SSPI;Database=Test2005;Application Name=Test Application A"
    conn.Open()
    Dim datAdapter As New
    SqlClient.SqlDataAdapter
    Dim ds As New
    DataSet
    Dim sqlCmd As New
    SqlClient.SqlCommand
    sqlCmd.CommandType = CommandType.Text
    sqlCmd.CommandText =
    "SELECT * FROM TestTable"
    sqlCmd.Connection = conn
    datAdapter.SelectCommand = sqlCmd
    datAdapter.Fill(ds)



  • CG_JCAHO

    Thank you for your reply. It’s good to know that it is possible (I should have guessed really). Will try it at a later stage. For now I will just follow the examples in my book.

    Thanks,

    Chris



  • rumrunner

    In order for this to work, do I have to install SQL Server Express itself

    on the server or just have it running on the local machine and the mdf file

    on the server

    I've done the bit with enabling TCP/IP and starting the browser service and of course

    I still can't create a database/connection thru the wizard but I'm thinking you're saying

    that I don't need to. Truthfully, I'm more comfortable coding the connection.

    Thank you


  • Jobria

    hi,

    there are differences between wizards and vb ability, when you creat a datasource you will find the wizard simply ask you do you want to import the database to your project or not and you said ok so that it came to your project folder if you have it allready on your disk, or you can build it.

    but also in visualbasic you have option to build your connection string programaticly to connect to any database you have permission to access it even over internet :d which i don't know how to connect to sqlserver over a Lan yet, but i can do that in microsoft access by changing the data source string

    hope this helps



  • Queue256

    Thanks Stephen,

    Your reply is most helpful. The coding goes a little over my head at the moment, but I have saved it for a later date.

    Many thanks,

    Chris



  • Distributing a multi-user application