本文介绍了从一个文件夹向另一个文件夹写入访问数据库.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将ms access db从一个文件夹写入另一个文件夹,而没有任何危险.我尝试了一些代码,但它给出了这样的错误
"
I want to write the ms access db from one folder to another with out any dattalose. I try some code but it giving error like this
"
Access to the path 'C:\Documents and Settings\Duane.DGAGENCI-FA286T\My Documents\ECatalog\ECatalog Update\Database\CANASIA TOYS & GIFTS' is denied.
"
这是我的代码,我可以从中更改
"
Here is my code wat i can change from this
if (File.Exists("C:\\Documents and Settings\\Duane.DGAGENCI-FA286T\\My Documents\\ECatalog\\ECatalog Update\\Database\\CANASIA TOYS & GIFTS\\CANASIA TOYS & GIFTS PRODUCTS.mdb"))
{
File.Delete("C:\\Documents and Settings\\Duane.DGAGENCI-FA286T\\My Documents\\ECatalog\\ECatalog Update\\Database\\CANASIA TOYS & GIFTS\\CANASIA TOYS & GIFTS PRODUCTS.mdb");
}
string path1 = "C:\\Documents and Settings\\Duane.DGAGENCI-FA286T\\My Documents\\ECatalog\\ECatalog Update\\Database\\CANASIA TOYS & GIFTS";
byte[] ReadDb = ReadFile("C:\\Documents and Settings\\Duane.DGAGENCI-FA286T\\My Documents\\Canasia\\ECatalog April 12-1\\MergeMacro\\CANASIA TOYS & GIFTS PRODUCTS.mdb");
MemoryStream msdb = new MemoryStream(ReadDb);
FileStream fsdb = new FileStream(path1, FileMode.Open, FileAccess.ReadWrite);
byte[] writedb = msdb.ToArray();
fsdb.Write(writedb, 0, writedb.Length);
msdb.Close();
fsdb.Close();
任何人请解决问题.我无法解决该问题,请在c#.net
anyone please solve the problem. i could not solve that issue please send charect coding in c#.net
推荐答案
这篇关于从一个文件夹向另一个文件夹写入访问数据库.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!