首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法访问服务器上的sqlite数据库

无法访问服务器上的sqlite数据库
EN

Stack Overflow用户
提问于 2019-02-07 08:28:12
回答 1查看 224关注 0票数 0

我正在尝试复制sqlite db文件并通过网络访问它。

当我尝试访问sqlite db的副本时,问题在服务器上,尽管当我在localhost上运行应用程序时,它工作得非常好。

代码语言:javascript
复制
public bool CopyDB()
    {
        string fileName = "spiceworks_prod.db";
        string sourcePath = "\\\\vapp01\\Spiceworks\\db";
        string targetPath = "\\\\vapp01\\Spiceworks\\db\\backup\\temp";



        // Use Path class to manipulate file and directory paths.
        string sourceFile = System.IO.Path.Combine(sourcePath, fileName);
        string destFile = System.IO.Path.Combine(targetPath, fileName);

        // To copy a folder's contents to a new location:
        // Create a new target folder, if necessary.
        if (!System.IO.Directory.Exists(targetPath))
        {
            System.IO.Directory.CreateDirectory(targetPath);
        }

        // To copy a file to another location and 
        // overwrite the destination file if it already exists.
        if (!System.IO.Directory.Exists(destFile))
        {
            File.SetAttributes(destFile, FileAttributes.Normal);
            System.IO.File.Copy(sourceFile, destFile, true);

            return true;
        }
        else
        {
            return false;
        }

无法打开数据库文件

Here is a picture of the error description

EN

回答 1

Stack Overflow用户

发布于 2019-02-08 08:23:56

我设法找出了它的真正原因。

我发现的问题与服务器中的sqlite数据库有关。不知何故,它不允许通过网络复制。

来解决这个问题。我已经生成了一个脚本来复制文件,并在每次应用程序运行时触发它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54564648

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档