Link to home
Start Free TrialLog in
Avatar of GeekHipster
GeekHipster

asked on

Pervasive SQL error message

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

ASKER CERTIFIED SOLUTION
Avatar of Mirtheil
Mirtheil
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GeekHipster
GeekHipster

ASKER

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.