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. Connection string

Connection string

Scheduled Pinned Locked Moved Visual Basic
helpcsharpdatabasetutorial
7 Posts 3 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.
  • D Offline
    D Offline
    dcode25
    wrote on last edited by
    #1

    Please help me I 'm developping a vb.net application .I create with wizard connection to a Ms access database and i have created all the forms with datagrid , listboxes ... all bounded with tables in this dataset. the problem is : Every month is created a new empty ms access database identical with the first one .This new month i want to connect the program with new databse and work with it .This procedure repeat every new month. How to change the connection string at runtime from one database to another. i repeat that databases are identical. Thank you in advance !

    P 1 Reply Last reply
    0
    • D dcode25

      Please help me I 'm developping a vb.net application .I create with wizard connection to a Ms access database and i have created all the forms with datagrid , listboxes ... all bounded with tables in this dataset. the problem is : Every month is created a new empty ms access database identical with the first one .This new month i want to connect the program with new databse and work with it .This procedure repeat every new month. How to change the connection string at runtime from one database to another. i repeat that databases are identical. Thank you in advance !

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      mysybet123 wrote:

      Every month is created a new empty ms access database identical with the first one .This new month i want to connect the program with new databse and work with it .This procedure repeat every new month.

      Doesn't sound like a very efficient thing to be doing.

      "The clue train passed his station without stopping." - John Simmons / outlaw programmer

      P 1 Reply Last reply
      0
      • P Paul Conrad

        mysybet123 wrote:

        Every month is created a new empty ms access database identical with the first one .This new month i want to connect the program with new databse and work with it .This procedure repeat every new month.

        Doesn't sound like a very efficient thing to be doing.

        "The clue train passed his station without stopping." - John Simmons / outlaw programmer

        P Offline
        P Offline
        penguin5000
        wrote on last edited by
        #3

        As Paul wrote, it does seem a little odd to be doing what you want to do. I'm sure you have your reasons. A couple of options for you: 1. Your database name remains static, and when you launch the application in a new month, it renames your current database to something else, and creates/copies your blank database in its place. This way, you always connect to a database with the same name. 2. You declare a string variable (strMonth), and then have some code that decides which month you are in, and assigns a value to strMonth - so if you're in July, strMonth = "July". You then connect to strMonth, and not a specifically named file. An array of months might be an efficient method of doing this.

        D 1 Reply Last reply
        0
        • P penguin5000

          As Paul wrote, it does seem a little odd to be doing what you want to do. I'm sure you have your reasons. A couple of options for you: 1. Your database name remains static, and when you launch the application in a new month, it renames your current database to something else, and creates/copies your blank database in its place. This way, you always connect to a database with the same name. 2. You declare a string variable (strMonth), and then have some code that decides which month you are in, and assigns a value to strMonth - so if you're in July, strMonth = "July". You then connect to strMonth, and not a specifically named file. An array of months might be an efficient method of doing this.

          D Offline
          D Offline
          dcode25
          wrote on last edited by
          #4

          Thank you for your responses. But there is a problem : there are 2 ore 3 users in network running this program and this users may work with different month database at the same time (these databases are located in one computer) .And i want to make possible that users can connect to the database they want. ( i have make this thing very easy in Ms Access but for some reasons i want to make a front-end in vb.net) Someone tell me to change the My.Settings.Connection String but i don't know how to do it. Thank you

          P 1 Reply Last reply
          0
          • D dcode25

            Thank you for your responses. But there is a problem : there are 2 ore 3 users in network running this program and this users may work with different month database at the same time (these databases are located in one computer) .And i want to make possible that users can connect to the database they want. ( i have make this thing very easy in Ms Access but for some reasons i want to make a front-end in vb.net) Someone tell me to change the My.Settings.Connection String but i don't know how to do it. Thank you

            P Offline
            P Offline
            Paul Conrad
            wrote on last edited by
            #5

            Is the database structurally the same from month to month? I am still very bothered by the scheme of having a new database every month. If the structure is remaining the same, you can mark the records/rows based on what month it belongs to. This would get rid of having multiple databases and multiple connection strings...

            "The clue train passed his station without stopping." - John Simmons / outlaw programmer

            D 1 Reply Last reply
            0
            • P Paul Conrad

              Is the database structurally the same from month to month? I am still very bothered by the scheme of having a new database every month. If the structure is remaining the same, you can mark the records/rows based on what month it belongs to. This would get rid of having multiple databases and multiple connection strings...

              "The clue train passed his station without stopping." - John Simmons / outlaw programmer

              D Offline
              D Offline
              dcode25
              wrote on last edited by
              #6

              Thank you ! The database structure is the same but the number and the size of records in a month is very large and if i take only one database after 2 ore 3 months the database size can reach the size limit of Ms Access database ( 2 Gb or i'm wrong !!!). Now i'm thinking to connect in runtime and i think it's easy to change the database.

              P 1 Reply Last reply
              0
              • D dcode25

                Thank you ! The database structure is the same but the number and the size of records in a month is very large and if i take only one database after 2 ore 3 months the database size can reach the size limit of Ms Access database ( 2 Gb or i'm wrong !!!). Now i'm thinking to connect in runtime and i think it's easy to change the database.

                P Offline
                P Offline
                Paul Conrad
                wrote on last edited by
                #7

                What kind of data are you going to be putting in the database to make it grow that large so fast?

                "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                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