Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. error in oledb connection string

error in oledb connection string

Scheduled Pinned Locked Moved Visual Basic
helpdatabaseannouncement
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thomas_joyee
    wrote on last edited by
    #1

    Hi, I just want to connect with an microsoft access database in a remote mechine. At first i try to connect with a database in local mechine. Dim Cn As OleDbConnection Dim strConString As String strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\localhost\D:\News\News\bin\News.mdb" Cn = New OleDbConnection(strConString) Cn.Open() i got an error : '\\localhost\D:\News\News\bin\News.mdb' is not a valid path. Please help me. Thanks Thomas

    S 1 Reply Last reply
    0
    • T thomas_joyee

      Hi, I just want to connect with an microsoft access database in a remote mechine. At first i try to connect with a database in local mechine. Dim Cn As OleDbConnection Dim strConString As String strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\localhost\D:\News\News\bin\News.mdb" Cn = New OleDbConnection(strConString) Cn.Open() i got an error : '\\localhost\D:\News\News\bin\News.mdb' is not a valid path. Please help me. Thanks Thomas

      S Offline
      S Offline
      Steve Pullan
      wrote on last edited by
      #2

      thomas_joyee wrote:

      i got an error : '\\localhost\D:\News\News\bin\News.mdb' is not a valid path.

      Yea, right. So what have you done to attempt to solve this problem? Tell us so we can help you. ...Steve 1. quod erat demonstrandum 2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once :-)

      T 1 Reply Last reply
      0
      • S Steve Pullan

        thomas_joyee wrote:

        i got an error : '\\localhost\D:\News\News\bin\News.mdb' is not a valid path.

        Yea, right. So what have you done to attempt to solve this problem? Tell us so we can help you. ...Steve 1. quod erat demonstrandum 2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once :-)

        T Offline
        T Offline
        thomas_joyee
        wrote on last edited by
        #3

        Sir, i tried following options. strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\127.0.0.1\D:\News\News\bin\News.mdb" strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\computername\D:\News\News\bin\News.mdb". But these are not working. Thanks for your reply Thomas

        S 1 Reply Last reply
        0
        • T thomas_joyee

          Sir, i tried following options. strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\127.0.0.1\D:\News\News\bin\News.mdb" strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\computername\D:\News\News\bin\News.mdb". But these are not working. Thanks for your reply Thomas

          S Offline
          S Offline
          Steve Pullan
          wrote on last edited by
          #4

          You are first trying to connect to an MDB on your local machine right? If so, the Data Source parameter is malformed for a local path. That's what the error message has told you already. Try copying the path you specify into the address box of Windows Explorer and see what it tells you. Now modify it until it works and then you should be able to use that in your connect string. ...Steve 1. quod erat demonstrandum 2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once :-)

          T 1 Reply Last reply
          0
          • S Steve Pullan

            You are first trying to connect to an MDB on your local machine right? If so, the Data Source parameter is malformed for a local path. That's what the error message has told you already. Try copying the path you specify into the address box of Windows Explorer and see what it tells you. Now modify it until it works and then you should be able to use that in your connect string. ...Steve 1. quod erat demonstrandum 2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once :-)

            T Offline
            T Offline
            thomas_joyee
            wrote on last edited by
            #5

            Hi, with windows explorer i found this code will work. strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\127.0.0.1\D\News\News\bin\News.mdb" Thanks for your valuable help. Thomas

            S 1 Reply Last reply
            0
            • T thomas_joyee

              Hi, with windows explorer i found this code will work. strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\127.0.0.1\D\News\News\bin\News.mdb" Thanks for your valuable help. Thomas

              S Offline
              S Offline
              Steve Pullan
              wrote on last edited by
              #6

              You are very welcome. Another happy customer :) ...Steve 1. quod erat demonstrandum 2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once :-)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups