Solved

Pervasive SQL error message

Posted on 2009-07-07
2
1,824 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

733 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