Hi Capricorn1,
Thanks.
What do you mean by in access VBA? I thought I can do this from ASP.NET.
I have a tmp.mdb - as a template database and would like to copy and paste it from asp.net... using c#..
Main Topics
Browse All TopicsHi all,
ASP.NET, C#, Microsoft Access Database.
When the user logon to my site, after the authentication, I would like to copy a database located in the /App_Code/tmp.mdb into /App_Code/sessionid.mdb. Then, once the user logs off, I want to delete this tmp database. /App_Code/sessionid.mdb.
If I was not able to delete the tmp database(if the user closes the browser instead of logging off), I will delete it when the user comes back - before copy a new one.
How will I achieve this? Copy, Paste and Give it a new name and Delete.
Thanks all
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks Capricorn.
(I am using ASP.NET, C# for web)
This is what I have so far and getting error:
URI formats are not supported
My Code:
public bool CopyTmpDB(string userName)
{
string path = "~/App_data";
string pathfrom = path + "tmpAtt.mdb";
string pathto = path + userName + ".mdb";
bool retVal = false;
try
{
// Create the file and clean up handles.
using( FileStream fs = File.Create(pathfrom)){}
// Ensure that the target does not exist.
File.Delete(pathto);
// Copy the file.
File.Copy(pathfrom, pathto);
Show("From " + pathfrom + "From " + pathto);
retVal = true;
return retVal;
}
catch
{
return retVal;
}
}
I still have not figure it out....
I changed File.Copy - to - WebClient - Since I was getting error message: URI formats not supported. I searched the internet and I found out that I should use WebClient.
This is what I have:
System.Net.WebClient wc = new System.Net.WebClient();
wc.DownloadFile("Http://ww
The Remote server returned an error: (404) Not found
Not sure why.. ? the domain address is correct.
Business Accounts
Answer for Membership
by: capricorn1Posted on 2008-01-17 at 12:12:12ID: 20684868
in access VBA, you will use
filecopy source,destination
to delete a db file
Kill \\server\folder\dbFile.mdb