Can't locate DLL
Posted: Fri May 17, 2024 12:05 am
Quick question..
This program runs well on my main computer. (Win 11 Pro 64 and Pure 6.11 beta)
Here's the problem snippet...
As you can see from the code, I am using 'DB Browser for SQLCipher'
(but I'm only using the sqlcipher.dll. And... it works well on my main computer)
When I try it on my Win 11 Home tablet (using PureBasic editor or the EXE), it appears not to find the sqlcipher.DLL
I get this error...
[16:36:54] [ERROR] Passkeeper.pb (Line: 78)
[16:36:54] [ERROR] UseODBCDatabase(), UseSQLiteDatase() or UsePostgreSQLDatabase() need to be called before using database commands.
Which is odd, as "sqlcipher.dll" is in the same directory as the code.
Debugging...
Debug UseSQLiteDatabase("sqlcipher.dll")
gives me a zero.
It's like PB 6.10 LTS can't find the DLL file to get to the next step.
I've tried adding..
UseSQLiteDatabase() No error, but can't find database
UseSQLiteDatabase(GetCurrentDirectory() + "sqlcipher.dll") does not work
Global myDLL.s = GetCurrentDirectory() + "sqlcipher.dll"
UseSQLiteDatabase(myDLL) Does not work
PS - I have the complete 'DB Browser for SQLCipher' installed and have no trouble opening the DB file directly.
Maybe there's some Windows setting that hides DLL's ??
This program runs well on my main computer. (Win 11 Pro 64 and Pure 6.11 beta)
Here's the problem snippet...
Code: Select all
; Libraries required
UseSQLiteDatabase("sqlcipher.dll") ; Use the DLL from 'DB Browser for SQLCipher'
UseMD5Fingerprint()
Declare CheckDatabaseUpdate(Database, Query$)
Declare.s Requester(Title$,Message$,DefaultString$)
;- Globals
Global DatabaseFile.s = GetCurrentDirectory()+"PassKeeper.db"
Global theImage.s
Global Quit
If OpenDatabase(0, DatabaseFile, "", "")
CheckDatabaseUpdate(0, "PRAGMA key = 'Lions On A Diet'") ; Database 'SALT'
If DatabaseQuery(0, "SELECT * FROM Keeper WHERE Website LIKE '%AAAA Passcode%';") ; get the password string from row selected
While NextDatabaseRow(0)
theImage = GetDatabaseString(0, 3) ; go to col 3 where the password 'Blueb' is located. (you can change this after initial opening)
Wend
FinishDatabaseQuery(0)
EndIf
EndIf
(but I'm only using the sqlcipher.dll. And... it works well on my main computer)
When I try it on my Win 11 Home tablet (using PureBasic editor or the EXE), it appears not to find the sqlcipher.DLL
I get this error...
[16:36:54] [ERROR] Passkeeper.pb (Line: 78)
[16:36:54] [ERROR] UseODBCDatabase(), UseSQLiteDatase() or UsePostgreSQLDatabase() need to be called before using database commands.
Which is odd, as "sqlcipher.dll" is in the same directory as the code.
Debugging...
Debug UseSQLiteDatabase("sqlcipher.dll")
gives me a zero.
It's like PB 6.10 LTS can't find the DLL file to get to the next step.
I've tried adding..
UseSQLiteDatabase() No error, but can't find database
UseSQLiteDatabase(GetCurrentDirectory() + "sqlcipher.dll") does not work
Global myDLL.s = GetCurrentDirectory() + "sqlcipher.dll"
UseSQLiteDatabase(myDLL) Does not work
PS - I have the complete 'DB Browser for SQLCipher' installed and have no trouble opening the DB file directly.
Maybe there's some Windows setting that hides DLL's ??