Jump to content

_SQLite_Open fails with permission denied


Recommended Posts

Hi,

I have an autotoit script with _SQLite_open() that works when compiled but gets @error=1 and @extended=3 when run from scite. @extended=3 is "Access permission denied".

As you can see, its pretty bog standard stuff.

Does anyone know why this is please?

_SQLite_Startup()
If @error Then
    MsgBox(16, "SQLite Error", "SQLite3.dll Can't be Loaded")
    Exit -1
EndIf

Global $db1 = _SQLite_Open("viewer2.db", $SQLITE_OPEN_READWRITE)
If @error Then
    MsgBox(16, "SQLite Error", "Can't open viewer2.db " & @error & " " & @extended)
    Exit -1
EndIf

 

Link to comment
Share on other sites

Could be a question of version, make sure you got latest version of all softwares and FULL scite version.  You may also want to copy both Sqlite.dll (x86 and x64) locally with your script and .db.  And use _SQLite_Startup("sqlite3.dll", False, 1)  see if that works...

 

Link to comment
Share on other sites

Thank you Nine.

I have downloaded and reinstalled Autoit and scite. Versions 3.3.14.5 and 4.1.2 respecively. Tested again with same results.

Added the _SQLite_Startup("sqlite3.dll", False, 1)  as recommended and tested again. Same results.

Downloaded a new 32bit SQLite.dll and put it in the same folder as the script and db (it was there already but a slightly older version). Same results.

Regarding the 64 bit dll, it has the same name as the 32bit dll so can only have one or the other. Have tried each, one at a time, same results.

I'm stumped!

I'm going to copy the whole lot to another PC. Will update you on the results.

Link to comment
Share on other sites

x64 version must be called sqlite3_x64.dll, otherwise it won't work...and x86 version must be called sqlite3.dll

Make sure you haven't mix them up !

 

Edited by Nine
Link to comment
Share on other sites

Sorry, my typo on the 32bit dll. Its name was correct. I have copied the 64bit dll as  sqlite3_x64.dll and retested. No change. Will work compiled but not from within scite.

I have copied all to another PC. All works perfectly. So, it is something to do with the PC. (File system permissions on the folder and files within are all identical between the PCs). Not sure what else to compare. I will deinstall everything and reinstall. Any other thoughts gratefully received.

Link to comment
Share on other sites

Deinstalled. Reinstalled. Same result. Completely stumped.

It has not set the default associations (I asked for double click to open script rather than running it) and it has not installed  the right-click->New->Autoit Script shorcuts. Something very odd with the PC.

Link to comment
Share on other sites

11 minutes ago, adrianhudson said:

Deinstalled. Reinstalled. Same result. Completely stumped.

It has not set the default associations (I asked for double click to open script rather than running it) and it has not installed  the right-click->New->Autoit Script shorcuts. Something very odd with the PC.

Some ppl had a similar problem as you in the past.  It was something related to PC configuration coming from a corporate image.  If this is your case, a fresh install of windows from CDs may solve your issues.

Link to comment
Share on other sites

Make sure to specify the full path to the DB file.  In your first post snippet, the DB file has to reside in the same folder as the .au3 source file.

Also check permissions for the DB folder.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...