Networking With Vb6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • darrel
    New Member
    • Nov 2006
    • 72

    Networking With Vb6

    Hello there VB wizards. I have a few questions, regarding how networking works with Visual Basic. It's like this - I have a PC that has the database of all my system. It's like a central database pc. Now I want to know how I can access those databases in another PC. For able for me to me achieve network.

    By the way, the databases that are in the central database PC are all Access.

    Another question; Will App Path work in accessing another pc?

    Can someone guide me to the right path, or give some sites or tutorials on how I can achieve my goal?

    Thank you very much.

    Looking forward for some tips...
    Last edited by Killer42; Dec 14 '07, 03:56 AM.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    To access the MDB files you need to specify either the system name or ipaddress from the client pc.

    better to put the database files in a shared with password for database.

    Comment

    • darrel
      New Member
      • Nov 2006
      • 72

      #3
      Thank you for that information, but how can i achieve it, can you give me some example codes of that, or could you give some tutorials or site on how to do it.. Thank you very much...

      Comment

      • darrel
        New Member
        • Nov 2006
        • 72

        #4
        Hi guys so far this is the code i have, but it gives me an error that the path name is not valid

        Code:
        Set cnn = New ADODB.Connection
        cnn.ConnectionString = _
         "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                  "Data Source=" & App.Path & "\\192.168.1.60\C:\My Documents\DentalDB.mdb;"
        cnn.Open
        192.168.1.60 is the ip address of the computer where the DentalDB.mdb is located...

        i think my format is incorrect... Can you give mea little information about this matter.. Thank you.

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by darrel
          "Data Source=" & App.Path & "\\192.168.1.60 \C:\My Documents\Denta lDB.mdb;"
          My guess is you should be using either the IP address or App.Path, not both.

          Comment

          • darrel
            New Member
            • Nov 2006
            • 72

            #6
            Networking With Vb6

            Hey Guys i already achieve what i want i was able to access my database for different a computer/s... To share with you,, heres my code...

            Code:
            Dim cnn As New ADODB.Connection
            Dim Str As String
            
            Set cnn = New ADODB.Connection
            Str = "\\Lbv\shareddocs\DentalDB.mdb"
            cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Str + ";Persist Security Info=False"
            cnn.CursorLocation = adUseClient
            Where Lbv is the Computer Name, shareddocs is the folder name, and DentalDb.mdb is the database itself...

            I hope it can contribute.... To all who replied.. Thank you.!!!
            Last edited by darrel; Dec 17 '07, 02:41 AM. Reason: incomplete deatils

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Thanks for sharing. That could be useful for anyone with similar problems in future.

              The more people who contribute, the better it gets. :)

              Comment

              Working...