?
Solved

Pervasive SQL error message

Posted on 2009-07-07
2
Medium Priority
?
1,973 Views
Last Modified: 2013-12-25
I am receiving the following error from a CREATE PROCEDURE statement being executed through Pervasive.Data.SqlClient.Dll version 2.10.1.2 against WGE 9.6

The statement works fine on other DSNs, and has also worked fine on this DSN until today, super.

I really need to know why this is happening, and ideally how to prevent it from randomly appearing on client machines after deployment.

The exception is thrown on the "ExecuteNonQuery()" in my code snippit.

Pervasive.Data.SqlClient.PsqlException was caught
  ErrorPosition=0
  Message="Pervasive.Data.SqlClient.Lna.LnaException: [LNA][Pervasive][ODBC Engine Interface][Data Record Manager]Access to the requested file is denied(Btrieve Error 46)"
  Number=-4953
  Source="Pervasive.Data.SqlClient"
  SQLState="0"
  StackTrace:
       at Pervasive.Data.SqlClient.Lna.LnaObject.CheckError(LnaResponse res)
       at Pervasive.Data.SqlClient.Lna.LnaStatement.Execute(ParamInfoSet pis)
       at Pervasive.Data.SqlClient.PsqlCommandImpl.execute(Boolean parseOnly, CommandBehavior behavior, Boolean needReader)
       at Pervasive.Data.SqlClient.PsqlCommandImpl.doExecuteNonQuery()
       at DDInt.Common.CommonCommandImpl.ExecuteNonQuery()
       at Pervasive.Data.SqlClient.PsqlCommand.ExecuteNonQuery()
  InnerException:

Dim cmdCreateProc As Pervasive.Data.SqlClient.PsqlCommand = m_Connection.CreateCommand()
cmdCreateProc.CommandText = strSql
If cmdCreateProc.Connection.State <> ConnectionState.Open Then cmdCreateProc.Connection.Open()
cmdCreateProc.ExecuteNonQuery()

Open in new window

0
Comment
Question by:GeekHipster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
mirtheil earned 2000 total points
ID: 24798350
The definition of a status 46:
46: Access to the requested file is denied

The MicroKernel returns this status code for the following reasons:

    * The application opened a file in Read-only mode and tried to perform a Write operation on that file.
    * The application attempted to perform a Write operation on a file that is flagged read-only by the operating system.
    * When the application opened the file, it did not correctly specify the owner name required for updates.
    * (Workgroup engine only) If a Workgroup engine user or task opens a file that a client machine has opened using a server MicroKernel, the MicroKernel returns this status code if the Workgroup engine user attempts to write to the file.
    * (9.x and higher engines only) The application attempted to perform a Write operation on a 5.x format file. When using a 9.x or higher engine, you cannot perform a write operation such as insert or delete on a 5.x format file.




If this is happening randomly, I would guess that some other process is locking one of the Pervasive files (since you're creating a procedure it is probably PROC.DDF).  Usually, this locking can be traced back to backup or anti-virus software.  Make sure you're not scanning the PSQL data files (including DDFs) with your AV when these errors occur.  
0
 
LVL 1

Author Comment

by:GeekHipster
ID: 24803482
This had to do with an elusive ReadOnly flag and a seemingly inconsistent existence of ~PVSW~.LOC file which was preventing my connections from recognizing that I had turned off the silly ReadOnly flag a hundred years ago!    :)

Anyway, turn off ReadOnlys, restart Pervasive Engine, life is good.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question