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. Problem with Connection String

Problem with Connection String

Scheduled Pinned Locked Moved Visual Basic
csharpsysadminhelpquestion
7 Posts 5 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.
  • G Offline
    G Offline
    garga1
    wrote on last edited by
    #1

    Hi Frnds.. I hv developed a Bill Contract Software in Vb.Net 2005(Windows application) , using vb as a language and msaccess as backend. I want to store all the data in the server. So i hv copied msaccess file to my personal domain inside wwwroot folder. Now i dont want to store data in my PC. It should be stored in the server directly. Can anyone tell me what is the connection string for that... Thank you...

    C 1 Reply Last reply
    0
    • G garga1

      Hi Frnds.. I hv developed a Bill Contract Software in Vb.Net 2005(Windows application) , using vb as a language and msaccess as backend. I want to store all the data in the server. So i hv copied msaccess file to my personal domain inside wwwroot folder. Now i dont want to store data in my PC. It should be stored in the server directly. Can anyone tell me what is the connection string for that... Thank you...

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Yes, it's a path to the mdb, across the network to the server machine.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      G 1 Reply Last reply
      0
      • C Christian Graus

        Yes, it's a path to the mdb, across the network to the server machine.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        G Offline
        G Offline
        garga1
        wrote on last edited by
        #3

        Thanks.. But plse tell me how to give the path..

        A R D 3 Replies Last reply
        0
        • G garga1

          Thanks.. But plse tell me how to give the path..

          A Offline
          A Offline
          Anoop Brijmohun
          wrote on last edited by
          #4

          hi try looking in here...http://www.carlprothman.net/Default.aspx?tabid=81

          1 Reply Last reply
          0
          • G garga1

            Thanks.. But plse tell me how to give the path..

            R Offline
            R Offline
            Rupesh Kumar Swami
            wrote on last edited by
            #5

            hi, simply create a log file, which store the path of your database. Let me explain first of all , make a form which ask from user for database path and set this form as startup form. Now at load event of this form check whether logfile(path.txt) is exist or not and perform action according to condition. I use following code in most appliction If File.Exists(Application.StartupPath & "\Path.txt") Then FileClose(1) Dim s As String FileOpen(1, "path.txt", OpenMode.Input) Input(1, s) Dim FilePath As String FilePath = s TextBoxSetDatabasePath.Text = FilePath If File.Exists(FilePath) Then FilePath = FilePath.Substring(FilePath.LastIndexOf("\") + 1) If FilePath.Trim.ToUpper = "YOURDATABASENAME.MDB" Then DatabasePath = TextBoxSetDatabasePath.Text.Trim ' DatabasePath is global variable LoginForm1.Show() Me.Close() Else msgbox("Wrong database file. Please choose correct database file") End If Else msgbox(("Database file not found. Please choose the database file.") End If Else mdChecking.Prompt("Database Path not set. Please choose Database file.") End If use databasepath varible value in connectionstring. for prompt user to pick correct database file use following procedure Try If TextBoxSetDatabasePath.Text <> "" Then If Not File.Exists(TextBoxSetDatabasePath.Text.Trim) Then mdChecking.Prompt("Incorrect database file. Please choose correct database file") Exit Sub Else Dim FilePath As String = TextBoxSetDatabasePath.Text.Trim FilePath = FilePath.Substring(FilePath.LastIndexOf("\") + 1) If FilePath.Trim.ToUpper = ""YOURDATABASENAME.MDB".MDB" Then DatabasePath = FilePath.Trim 'If File.Exists(Application.StartupPath & "\path.txt") Then ' File.Delete(Application.StartupPath & "\path.txt") 'End If Dim s As String FileClose(1) s = Application.StartupPath & "\path.txt" FileOpen(1, s, OpenMode.Output)

            1 Reply Last reply
            0
            • G garga1

              Thanks.. But plse tell me how to give the path..

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Well, you have a small problem. You can't connect to an Access database on the other side of a web server. Access is a file-based desktop database, not an SQL Server. It will only work if the user running your app can see the database file through a Windows Share, AND the user has read and write access to that share. Normally, noone gets those kind of permissions if the file is in the wwwroot folder or below.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              G 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Well, you have a small problem. You can't connect to an Access database on the other side of a web server. Access is a file-based desktop database, not an SQL Server. It will only work if the user running your app can see the database file through a Windows Share, AND the user has read and write access to that share. Normally, noone gets those kind of permissions if the file is in the wwwroot folder or below.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                G Offline
                G Offline
                garga1
                wrote on last edited by
                #7

                Thanks.. Thanks for everyone.. I got the solution..

                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