bibib Posted November 20, 2006 Share Posted November 20, 2006 Hi,I need to create a page where the user will be able to install a new .mdb file at a specific location. So In this page, the user will only type the location/path where the .mdb file should be installed. I want the tables within the .mdb file to be created automatically (The tables will be the same everytime a new database file is installed).Is this possible to be done with ASP.NET? Either way, can you help me with the code or give me some references ?Thanks Link to comment Share on other sites More sharing options...
jesh Posted November 20, 2006 Share Posted November 20, 2006 What if you created the .mdb file with all the appropriate tables and then simply made copies of it for the new users?Using the System.IO.File class, it could look something like this: string path = Server.MapPath("whatever/the/path/is/"); string originalFile = path + "template.mdb"; string newFile = path + "newfile.mdb"; if(System.IO.File.Exists(originalFile)) { System.IO.File.Copy(originalFile, newFile); } Link to comment Share on other sites More sharing options...
bibib Posted November 22, 2006 Author Share Posted November 22, 2006 Hi jesh and thanks!So will the new file always be named newfile.mdb? It doesn't really matter in my case, I just need to demonstrate to my university that A new file can be created with specific tables once the user clicks on a function button on a page..Thanks again Link to comment Share on other sites More sharing options...
aspnetguy Posted November 22, 2006 Share Posted November 22, 2006 yes in this case it would always be named newfile.mdb Link to comment Share on other sites More sharing options...
jesh Posted November 22, 2006 Share Posted November 22, 2006 But you could always dynamically generate the name of the new file. You could also save it in different directories - perhaps based on a user id or some other data. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now