Click here to Skip to main content
11,705,212 members (37,659 online)
Rate this: bad
good
Please Sign up or sign in to vote.
Hi,
I have designed one vb.net application with ms access database.

I use following connectionstring to Connect :

Provider=microsoft.Jet.oledb.4.0;Data Source=D:\mydata.mdb

I want to distribute this application to other users in LAN (Network)

but should share common (centralized) database.

How should I proceed ?

Thanks...
Posted 16-Jan-13 22:20pm
Comments
OneInNineMillion at 17-Jan-13 4:51am
   
A couple of questions you might want to answer to let us help you better:

Where do you want to store the database?
What does the application do? What kind of use do you expect?
I ask these things because if you want your database to be constantly available and on your PC it might slow your PC down.

I'm sorry I can't provide you with an answer, but I hope the next person will be able to do that. Editing your original post to answer these questions might help that person.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Imports System.Data.Oledb
 

    Dim con As New OledbConnection("Provider=microsoft.Jet.oledb.4.0DataSource=D:\mydata.mdb;")
 
    Dim cmd As New OledbCommand
 
    Public var1 As String
 
    Public Sub New()
        con.Open()
 
        cmd.Connection = con
        cmd.CommandText = "SELECT * FROM table1"
 
    End Sub
 
    Public Sub creates()
        cmd.CommandText = "INSERT INTO table1(Neyms) VALUES('" + var1 + "')"
        cmd.ExecuteNonQuery()
 
    End Sub
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Grabs data from a table and posts it into a ListView
Dim Table_ As String = "Table1"
Dim query As String = "SELECT * FROM " & Table_
Dim MDBConnString_ As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=TestDatabase.mdb;"
Dim ds As New DataSet
Dim cnn As OleDbConnection = New OleDbConnection(MDBConnString_)
cnn.Open()
Dim cmd As New OleDbCommand(query, cnn)
Dim da As New OleDbDataAdapter(cmd)
da.Fill(ds, Table_)
cnn.Close()
Dim t1 As DataTable = ds.Tables(Table_)
Dim row As DataRow
Dim Item(2) As String
For Each row In t1.Rows
    Item(0) = row(0)
    Item(1) = row(1)
    Dim NextListItem As New ListViewItem(Item)
    ListView1.Items.Add(NextListItem)
Next
  Permalink  
Comments
ddrraamm at 17-Jan-13 4:46am
   
I want to connect the access database(.mdb) on another PC with VB.NET application using IP Address or any how
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

If you are trying to use a central database for multiple instances of the application, then using Access is a really bad way to go.
The correct solution would be to use a SQL Server instance on the machine hosting the database. If you don't have licensing for SQL Server you could always use a different provider like MySQL.

If you really need to connect to the access db file from another machine, you would not be connection using an IP address, but rather a share path: ie. \\YourMachineName\AccessFolderShare\YourFile.mdb.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Just Share your folder database

and change path other user...

like this...

Dim MDBConnString_ As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\172.16.0.233\DatabaseFolder\DatabaseName.mdb;"
  Permalink  
Comments
Member 10804809 at 7-Jun-14 8:14am
   
I have same question- I have vb.net application and OLeDb database.
I want to Share the database between 3 pc and any pc can update the database by LAN connection.
So is this possible this method-

Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\SIS-JES4MPANRS0\C:\Users\Satyam\Documents\Pathology.accdb")

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 525
1 OriginalGriff 244
2 CPallini 82
3 ppolymorphe 76
4 Inimicos 60
0 OriginalGriff 8,988
1 Sergey Alexandrovich Kryukov 8,272
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 2 Feb 2014
Copyright © CodeProject, 1999-2015
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