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