• Welcome to SQLitening Support Forum. Please login.
 
December 03, 2021, 07:18:30 PM

News:

Welcome to the SQLitening support forums!


Recent posts

Pages1 2 3 ... 10
1
Dear all,

Is-it possible to setup the error logging Callback provided by SQLite when we use SQLitening ?

More info here:

https://www.sqlite.org/errlog.html

Thanks,
Jean-Pierre
2
You've got Questions? We've got Answers! / Re: Storing a PDF-file
Last post by Fim - March 04, 2021, 05:18:26 AM
Many thanks for an exhaustive answer.
/Fim W.
3
You've got Questions? We've got Answers! / Re: Storing a PDF-file
Last post by cj - March 03, 2021, 03:58:24 PM
Yes, any file type can be insert into a blob column, but it may not be the best choice.
PDF files can be saved in a database, but client or I copy them "as is" into a folder for each client.
The client can click on them or do anything without having to save to a database and extract.
Chrome browser displays PDF files very well or SHELL "filename.pdf" to use default viewer for type "pdf".
Giving the client the option to open pdf folder allows them to select/display with a click.

#COMPILE EXE "SaveAnyFile"  'Save as "SaveAnyfile.Bas"
#INCLUDE "sqlitening.inc"
  
FUNCTION PBMAIN () AS LONG
 LOCAL sData AS STRING
 LOCAL sFileName AS STRING

 slOpen "junk.db3","C"
 slexe  "create table if not exists Table1(MyFile)"

 sFileName = "SaveAnyFile.bas"
 IF GetFileFromDisk(sFileName,sData) THEN EXIT FUNCTION
 slExeBind "insert into Table1 values(?)",slbuildbinddat(sData,"B")
 IF slGetChangeCount = 0 THEN ? "insert error":EXIT FUNCTION

 slsel "select rowid,Myfile from Table1"
 DO WHILE slGetRow
   ? CHR$("Rowid=",slfn("rowid"),$CR,$CR,slfn("MyFile"))
 LOOP
END FUNCTION

FUNCTION GetFileFromDisk(sFileName AS STRING,sData AS STRING) AS LONG
 sData = ""
 IF ISFILE(sFileName) = 0 THEN FUNCTION = 53:EXIT FUNCTION
 LOCAL hfile AS LONG
 hfile = FREEFILE
 OPEN sFileName FOR BINARY AS hFile
 IF ERR THEN FUNCTION = ERR:BEEP:EXIT FUNCTION
 GET$ hFile,LOF(hFile),sData
 IF ERR THEN FUNCTION = ERR
 CLOSE hFile
END FUNCTION
4
You've got Questions? We've got Answers! / Storing a PDF-file
Last post by Fim - March 03, 2021, 10:03:27 AM
Can a PDF file be stored in a database, if so how?
/Fim W.
5
You've got Questions? We've got Answers! / Re: Using slSetRelNamedLocks
Last post by Fim - December 30, 2020, 05:06:42 AM
Thanks for the advice and instructions. But I have decided to go another way to solve my problem, and it has gone well
6
You've got Questions? We've got Answers! / Re: Using slSetRelNamedLocks
Last post by Fim - December 17, 2020, 05:33:56 AM
How about this in SQlitening.bas
7
You've got Questions? We've got Answers! / Re: Using slSetRelNamedLocks
Last post by Fim - December 16, 2020, 01:37:31 PM
Many thanks. I should have read the manual better.
/Fim W.
8
You've got Questions? We've got Answers! / Re: Using slSetRelNamedLocks
Last post by cj - December 16, 2020, 01:15:11 PM
FUNCTION GetLockNames AS STRING
 'connect and open database before call
 LOCAL s1,s2 AS STRING, x AS LONG
 s1 = slGetStatus(1)
 IF LEN(s1) = 0 THEN EXIT FUNCTION
 REPLACE $VT WITH "," IN s1
 REPLACE $BS WITH "," IN s1
 FOR x = 2 TO PARSECOUNT(s1) STEP 8
  s2 = s2 + PARSE$(s1,x) + ","
 NEXT
 FUNCTION = LEFT$(s2,-1)
END FUNCTION
9
You've got Questions? We've got Answers! / Using slSetRelNamedLocks
Last post by Fim - December 16, 2020, 06:13:20 AM
Is there any way to find out what locks I have made with slSetRelNamedLocks?
/Fim W.
10
General Board / Re: slOpen memory leak
Last post by cj - August 03, 2020, 10:24:18 PM
Though I have not had a problem, I am removing this change in case
ATTACH or push the databases handles may need slOpen.  Better safe than sorry.

FUNCTION slOpen ALIAS "slOpen  ...
  IF thDab THEN EXIT FUNCTION  '<--- add  line in SQLitening.Bas and compile
Pages1 2 3 ... 10