• Welcome to SQLitening Support Forum.
 

News:

Welcome to the SQLitening support forums!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - cj

#31
Hope it helps.
Receive emails and alerts doesn't seem to be the default so you may not see this.

#33
Hopefully, everyone should turn on the option "RECEIVE EMAILS AND ALERTS".
Click on "Not Following" and change it.  There is a button to do this for each forum.
Also sent an private message.

Fredrick,
I only needed to use task scheduler on my Windows 11 machine.
The sqliteningserver.exe service auto starts on other computers.
#34
Let me know if you get email alerts working!!
I'm guessing you have the "Not Following" option as the default, like I did.
#35
Hopefully, we both have RECEIVE EMAILS AND ALERTS turned on!
If not, click on "Not Following" and change it.

I only needed to use task scheduler on my Windows 11 machine.
The sqliteningserver.exe service auto starts on other computers.
#36
In each thread there is a button that needs to be clicked to enable alerts!
I am now getting them.
Click "Not following" to "Receive Email and Alerts" by clicking on the button.
It has to be done in each forum to subscribe to a topic.

We must see a button at the bottom right saying "RECEIVE EMAIL AND ALERTS"




#37
I wondered why I wasn't receiving email alerts.
The button has to be changed to receive email alerts in upper right corner.

I have not yet received a notification.

#38
Correct, client only needs to slConnect.
In Windows 11 I have not been able to get the service SQLiteningServer.exe to autostart
even with delay.  I added an entry in task scheduler to retry a couple of times.  Kludge, but works.
The internet is not available for about a minute even after reaching the desktop.
This may be a problem only on my machine.

Note:  I also run a program named "filewatcher" from the PowerBASIC site.
I set it to monitor the file "sqliteningserver.log".  It displays every logon/logoff and select.
I also modified the server to update the log with every select command.
I can monitor what people are doing.
It also shows incorrect http requests. Might just filter them out, someday.

So freemyip.com always has your remote ip address (if it changes.)
1 Create a shortcut to freemyip.com with link provided for word selected onto desktop
2 Also copy the link to clipboard.  Use properties of shortcut to get it if needed.
3 Press Windows key + R
4 Type  shell:common startup 
5 Create new shortcut in startup folder
6 Paste in the link to freemyip.com
7 Save shortcut as some name like FreeMyIP
Link looks something like:https://freemyip.com/update?token=YOUR_UNIQUE_TOKEN
"YOUR_UNIQUE_TOKEN" links the word chosen by you at freemyip.com so they route to your current remote address.

I also have a shortcut on the windows desktop with the link and token to freemyip.com
I added it as above step number 1
The word "OK" is returned from freemyip.com if it is working.
Be sure to immediately save the link with unique token from freemyip.com.
There is no recovery process if it is lost.

It is also nice to put a link to \bin\filewatcher.exe in common startup folder.

Another thing is be sure if you are using a VPN to disconnect when connecting to freemyip.com
so they get your actual remote ip addresss.  With a good VPN service you can then turn it back on.
If using a VPN you may have to enable remote access (or some such setting) to allow inbound connections.

SQLitening encryption can only be used on the database.  It does not encrypt TCP transmissions.




#39
Demonstrate using a UDT with a blob column

Read/write files to blob https://sqlitening.planetsquires.com/index.php?topic=9676.msg25764#msg25764
Upsert could also be used  https://sqlitening.planetsquires.com/index.php?topic=9709.msg26107#msg26107

#INCLUDE "sqlitening.inc"
%DropTable=1

TYPE RecordType
 num1 AS LONG
 num2 AS CUX
 time AS STRING * 8
END TYPE

FUNCTION PBMAIN AS LONG 'fim10.bas
LOCAL rec    AS RecordType
LOCAL sKey,s,sPrompt,sTitle AS STRING

slOpen "junk.db3","C"
IF %DropTable THEN slexe "drop table if exists VER"
slexe  "create table if not exists VER(key text unique,blob)"
sKey = "fim"
DO
 sKey = INPUTBOX$(sPrompt,sTitle,sKey)
 IF LEN(sKey) = 0 THEN EXIT FUNCTION
 slexe "begin immediate

 slSel "select key,blob from VER where key=" + WRAP$(sKey,$SQ,$SQ)

 IF slGetRow THEN      'UPDATE
  s = slfn("blob")    'put blob into dynamic string
  TYPE SET rec = s    'set UDT  with dynamic string

  'modify members
  INCR rec.num1
  INCR rec.num2
  rec.time = TIME$
  s=rec                'put UDT into dynamic string
  s=slBuildBindDat(s)  'bind dynamic string
  slexebind  "Update ver Set blob = ? where key=?",s + slBuildBindDat(sKey,"T")
  IF slGetChangeCount = 0 THEN sTitle = "update failed" ELSE sTitle = "Update"
 ELSE
  'modify members
  rec.num1 = 1          'modify member1
  rec.num2 = rec.num1 +1'modify member2
  rec.time = TIME$      'modify member3

  s=rec                'put UDT into into dynamic string
  s=slBuildBindDat(s)  'bind dynamic string
  slexebind "insert into VER values(?,?)",slBuildBindDat(sKey,"T") + s
  IF slGetChangeCount = 0 THEN sTitle = "insert failed" ELSE sTitle = "Insert"
 END IF

 slexe "end"

 slSel "select * from VER where key=" + WRAP$(sKey,$SQ,$SQ)
 DO WHILE slGetRow
  TYPE SET rec = slfn("blob")
  sPrompt = USING$("num1=#&num2=#&&",rec.num1,$CR,rec.num2,$CR,rec.time)
 LOOP
LOOP
END FUNCTION
#40
Insert multiple 50-column records using a 2-dimensional array

#INCLUDE "sqlitening.inc"
MACRO bindt(str)=slbuildbinddat(str,"T")

FUNCTION PBMAIN AS LONG

LOCAL c,r,rows,cols AS LONG
cols = 50
rows = 2

REDIM s(1 TO cols,1 TO rows) AS STRING
slOpen    "junk.db3","C"
slexe    "create table if not exists t1(c1 text,c2 text,c3 text,c4 text,c5 text,c6 text,c7 text,c8 text,c9 text,c10 text,c11 text,"  +_
          "c12 text,c13 text,c14 text,c15 text,c16 text,c17 text,c18 text,c19 text,c20 text,c21 text,c22 text,c23 text," +_
          "c24 text,c25 text,c26 text,c27 text,c28 text,c29 text,c30 text,c31 text,c32 text,c33 text,c34 text,c35 text," +_
          "c36 text,c37 text,c38 text,c39 text,c40 text,c41 text,c42 text,c43 text,c44 text,c45 text,c46 text,c47 text," +_
          "c48 text,c49 text,c50 text)
FOR r = 1 TO rows
  FOR c= 1 TO cols
  s(c,r) = bindt(".")  '<--- INSERT DATA (COLUMN,ROW)
  NEXT
NEXT
slexe "begin exclusive"
slexebind "insert into t1 values(" + REPEAT$(cols-1,"?,") + "?)",JOIN$(s(),""),USING$("V#",UBOUND(s,1))
slexe "end"
LOCAL sRecordSet() AS STRING
slSelAry "select rowid, * from t1 order by rowid",sRecordSet(),"Q44"
? JOIN$(sRecordSet(),$CR)
END FUNCTION

#41
Eliminate 50-concatenations (increase ? marks to 50)
#INCLUDE ONCE "sqlitening.inc"
MACRO bind(str)=slbuildbinddat(str,"T")

FUNCTION PBMAIN AS LONG
 LOCAL sHospitalNo,sSurName AS STRING
 slOpen "junk.db3","C"
 slexe  "create table if not exists t1(c1 text, c2 text)"
 REDIM s(1 TO 50) AS STRING
 s(1) = bind(sHospitalNo)
 s(2) = bind(sSurName)
 slexebind "insert into t1 values(?,?)",JOIN$(s(),"")
END FUNCTION
#42
General Board / MOD is % in SQLite
April 10, 2022, 11:47:45 PM
Example: Get every 7th row
select rowid from parts where rowid%7=0 order by rowid
#43
General Board / MonthName macro
April 08, 2022, 04:10:20 AM
'https://stackoverflow.com/questions/650480/get-month-from-datetime-in-sqlite

MACRO monthname(ColumnName)="substr('JanFebMarAprMayJunJulAugSepOctNovDec', 1 + 3*strftime('%m',"+ColumnName+"), -3) month"

#INCLUDE "sqlitening.inc"

FUNCTION PBMAIN AS LONG

 slopen ":memory:"
 slexe  "create table t1(c1 text)
 slexe  "insert into t1 values(date('now'))"

 MSGBOX slselstr("select " + monthname("c1") + " from t1")
 MSGBOX slselstr("select substr('JanFebMarAprMayJunJulAugSepOctNovDec', 1 + 3*strftime('%m',c1),-3)as month from t1")

END FUNCTION
#44
This example shows 3-ways to get price column to order by numerically
if printf with "AS" using the "price" column name is used.
1. Use no AS and ignore the long column name
2. Specify parts.price in the order by
3. Use a different name with "AS" than the price column

#INCLUDE "sqlitening.inc"
GLOBAL gs AS STRING

FUNCTION PBMAIN AS LONG
 slOpen "junk.db3"
 slexe  "drop table if exists parts"
 slexe  "create table if not exists parts(price integer)"
 slexe  "insert into parts values(1995),(1300),(4995),(101),(703)"

 'if AS is used with same name as column with printf the order by will be alpha
 rs "select printf('%.2f',price*.01) AS price from parts order by price"

 'these order numerically
 rs "select printf('%.2f',price*.01) from parts order by price"                'no AS
 rs "select printf('%.2f',price*.01) AS price from parts order by parts.price" 'use table.column
 rs "select printf('%.2f',price*.01) AS XYZ from parts order by price"         'AS different
 ? gs
END FUNCTION

FUNCTION rs(sql AS STRING) AS STRING
 LOCAL sArray() AS STRING
 IF ISFALSE(slSelAry(sql,sArray(),"Q9 E2")) THEN
  gs+= JOIN$(sArray(),$CR) + $CR + $CR
 ELSE
  gs = "error:" + $CR + sql + $CR + $CR
 END IF
END FUNCTION



#45
General Board / FreeMyIp.Com very simple free DNS routing
February 09, 2022, 09:05:10 AM
Setup machine running SQLiteningServer.exe
1 type ipconfig at command prompt
2 look for IpV4 address under ethernet adapter, example 192.168.0.2
3 router software, port forward 51234 to 192.168.0.2
4 allow an app through windows firewall, click change settings, add sqliteningserver

Create shortcut
1 https://freemyip.com
2 enter unique word "klum", check availability, claim it and copy link provided
3 create new shortcut and paste link provided into location and name it "remote"
4 click "remote" shortcut and browser must return "Ok"
5 slconnect "klum.freemyipcom",51234

Execute "remote" shortcut at Windows startup if remote ip address changes

Fredrick,
I didn't see this old thread.
Hope you are doing great!!