Linked Questions

Popular Questions

Unable to access sqlite database on server

Asked by At

I'm trying to copy sqlite db file and access it over the network.

Issue is on server while trying to access the copy of sqlite db even though when i run application on localhost, it works absolutely fine.

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;
        }

Unable to open databasefile

Here is a picture of the error description

Related Questions