Liberty BASIC Community Forum
« Eye On SQL »

Welcome Guest. Please Login or Register.
Nov 17th, 2017, 8:34pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1 2 3  4 Notify Send Topic Print
 veryhotthread  Author  Topic: Eye On SQL  (Read 1727 times)
meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Eye On SQL
« Thread started on: Jul 6th, 2017, 4:54pm »

Wrote a program that helps in the maintenance of SQLite databases.
Some of the features:
Create new databases.
Load existing databases
Drop a database from the system
Execute SQL commands
Empty Tables
Create Tables
Drop Tables from a Database
Browse Tables
Delete Fields from a Table
Change Fields
Change Field properties
Add fields
Create index
Drop index
Export Schema and data. Including full data
Exports are a great way to backup databases.
Load data and Schema.
Enter SQL commands. A great way to test your commands before you add them to code..
And more....

I'm posting this a little early, because I'm out of town for a couple of weeks and thought people may need it. So expect and report bugs.

Download here http://www.kneware.com/libertyBasic/ionSQL/
There are some docs. Hopefully I can get this all done when I get back in town.

Have fun....


Just to prove the Sql command entry worked I used the following SQL command to search for required assets such as conference room or projector etc. And it did finds all the open slots for that particular asset .
The slots have to have enough time to meet your requirements. It only reports the number of open slots you request..
It uses 2 tables.. asset - what you wanna schedule, schTime - scheduled time already allocated.
I give it the following requirements:
minSlots.. the minimum slot needed in minutes
begSlotDate$.. the beginning date to search for open slots
numSlots.. Report only this many open slots.
schBy$ .. Increments in minutes to search by like 15 minutes intervals
Code:
SELECT  
s.schNum,
s.assetNum,
s.schEnd	as preEnd,
s1.schBeg	as nxtBeg,
((strftime('%s',s1.schBeg) - strftime('%s',s.schEnd)) / 60) as laps,
(strftime('%w',s.schEnd))   as dowBeg,
asset.descr	as aDescr,
asset.assetType
FROM	schTime	as s
JOIN	asset
ON	asset.assetNum = s.assetNum
JOIN	schTime   as s1
ON	s1.assetNum = s.assetNum
AND	s1.schBeg > s.schEnd
AND	((strftime('%s',s1.schBeg) - strftime('%s',s.schEnd)) / 60) >= "+minSlots+"
AND	s1.schBeg = (SELECT min(s2.SchBeg)
FROM	schTime   as s2
WHERE	s2.assetNum = s.assetNum
AND 	s2.schBeg > s.schEnd) "+schBy$+"
AND     s.schBeg >= "+begSlotDate$+" LIMIT "+numSlots
 
User IP Logged

metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Eye On SQL
« Reply #1 on: Jul 8th, 2017, 8:07pm »

Thanks for sharing Dan

If I add another field to the ionSQL.db db table then the loading of any more databases fails due to
Code:
INSERT INTO db VALUES('d','sample.db','C:\users\laurie\Application Data\Liberty BASIC v4.5.1\DATABASE\') 

having no data to insert into the new field.
the obvious answer is to not modify the main DB or I modify the SQL$

I now get fields from table before an insert, it would appear that fields with no data will still be saved (empty)
Code:
[LISTFIELDS]

    SQL$ = "Select * From "+Table$ +"  Limit 1"
    calldll #sq3, "SQ3_4_LB_GetRecordset", SQL$ as ptr,DBhnd as long,RS as     struct, ret as long
    FOR n = 0 TO RS.Cols.struct -1
    calldll #sq3, "SQ3_4_LB_GetFieldNameByIndex",n as long, ret as long
    fld$ = Winstring(ret)

    fldNames$= fldNames$;","+fld$
    NEXT n
    fldNames$ =after$( fldNames$,",")
'    print  fldNames$
    RETURN
 

« Last Edit: Jul 9th, 2017, 06:21am by metro » User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Re: Eye On SQL
« Reply #2 on: Jul 9th, 2017, 07:48am »

Ya! I could prevevt it from being loaded. But then you could simply use the SQL command section to load it or mess with it. I will have a look at it when I get back home in a few days.

Thanks for the info
Dan
User IP Logged

sarmednafi
New Member
Image


member is offline

Avatar




PM


Posts: 20
xx Re: Eye On SQL
« Reply #3 on: Jul 11th, 2017, 01:29am »

I can get nothing from this link:


Download here
http://www.kneware.com/libertyBasic/ionSQL/

The same problem here:

You can get lb_gen.bas here:
http//kneware.com/libertybasic/


Please help.
Regards
« Last Edit: Jul 11th, 2017, 01:33am by sarmednafi » User IP Logged

metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Eye On SQL
« Reply #4 on: Jul 11th, 2017, 02:40am »

Quote:
I can get nothing from this link:


Give it a try in a couple of days, I'm guessing his server is down and he is away
Quote:
I will have a look at it when I get back home in a few days.
User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
sarmednafi
New Member
Image


member is offline

Avatar




PM


Posts: 20
xx Re: Eye On SQL
« Reply #5 on: Jul 11th, 2017, 05:54am »

I see,
Thanks Metro.
User IP Logged

meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Re: Eye On SQL
« Reply #6 on: Jul 11th, 2017, 6:01pm »

Server is up!
You know how it works. The server never ever goes down when you are around. But leave town - and it's going down.

Anyone know how to do dynamic page layouts.
When you list a table I have buttons to [A]dd [C]hange [D]elete and [S]ee. These do not work because each table is different and I need to layout the detail page for each table. So it has to be done on the fly. I'm sure there is a simple way. I've even looked at a HTML layout with a JavaScript interface to LB. But LB has got to have a simple way somewhere that I've missed.

Thanks for the help.
Dan
User IP Logged

metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Eye On SQL
« Reply #7 on: Jul 11th, 2017, 7:21pm »

Sorry Dan, its not what you've asked for but...
I envisaged something like this, treeview outside my skill set ATM
(E)dit (A)dd or (C)hange via dialog_modal double click ListView to select the row

User Image
full size screen shot here
https://www.dropbox.com/s/s963epvuam3719l/Screenshot%20from%202017-07-12%2007-58-26.png?dl=0
code to get the idea
part1
Code:
   'set some globals
    GlOBAL hwndLV,columnIndex,maxrow
    Global   LVS.REPORT, LVS.NOSORTHEADER, LVS.SINGLESEL,_
        LVM.INSERTCOLUMN, LVCF.WIDTH, LVM.INSERTITEM,_
        LVCF.TEXT, LVM.SETITEM, LVIF.TEXT ,LVS.SHOWSELALWAYS,LVM.DELETEITEM
    
    'set global values
    'constants
    LVS.NOSORTHEADER = 32768
    LVS.REPORT = 1
    LVS.SINGLESEL = 4
    LVS.SHOWSELALWAYS = 8
    LVS.SORTASCENDING = 16
    LVS.SORTDESCENDING = 32
    LVS.NOLABELWRAP = 128
    LVS.AUTOARRANGE = 256
    LVS.NOSCROLL = 8192
    LVS.ALIGNTOP = 0
    LVS.ALIGNLEFT = 2048
    LVS.NOCOLUMNHEADER = 16384
    LVIF.TEXT = 1
    LVIF.STATE = 8
    LVIS.UNSELECTED = 0
    LVIS.FOCUSED = 1
    LVIS.SELECTED = 2
    LVM.FIRST = 4096
    LVM.SETITEM = 4102
    LVM.INSERTITEM = 4103
    LVM.INSERTCOLUMN = 4123
    LVM.GETITEMCOUNT = 4100
    LVM.GETITEMA = 4101
    LVM.GETITEMTEXTA = 4141
    LVM.GETITEMSTATE = 4138
    LVM.SETITEMSTATE = 4139
    LVM.DELETEITEM = 4104
    LVM.DELETEALLITEMS = 4105
    LVCF.WIDTH = 2
    LVCF.TEXT = 4
    'set starting values
    columnIndex=0
    
    
    'create structs
    Struct LVCOLUMN, _
        mask As ulong, _
        fmt As long, _
        cx As long, _
        pszText$ As ptr, _
        cchTextMax As long, _
        iSubItem As long, _
        iImage As long, _
        iOrder As long
    
    Struct LVITEM, _
        mask As ulong, _
        iItem As long, _
        iSubItem As long, _
        state As ulong, _
        stateMask As ulong, _
        pszText$ As ptr, _
        cchTextMax As long, _
        iImage As long, _
        lParam As long, _
        iIndent As long
    
    struct msg,_
        hndl as ulong,_
        message as long,_
        wParam as long,_
        lParam as long,_
        LOWORDwparam as word,_
        HIWORDwparam as word,_
        LOWORDlparam as word,_
        HIWORDlparam as word
    
    'initialize common controls:
    
    calldll #comctl32, "InitCommonControls",re as void
    
    'set style values
    style = _WS_CHILD OR _WS_VISIBLE OR LVS.NOSORTHEADER Or LVS.REPORT Or LVS.SINGLESEL Or LVS.SHOWSELALWAYS
    
    'setup window
   nomainwin
BackgroundColor$="darkcyan"

    WindowWidth = 550 : WindowHeight = 400
    UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
    UpperLeftY = INT((DisplayHeight-WindowHeight)/2)
    Menu        #main, "&File" , "E&xit", [quit]
    button #main.b1,"Edit",[editrow],ul,25,5,30,20
    button #main.b2,"Delete",[delete],ul,60,5,40,20
    button #main.b3,"Save List",[saveList],ul,105,5,60,20
    button #main.b4,"Load List",[loadList],ul,170,5,60,20
    button #main.GetMsgHookCallback, "button", [choice], ul, 230, 5, 60, 20
    Open "List View Example" for Window as #main
    #main "trapclose [quit]"
    
    hWin=hwnd(#main) 'get window handle
    hwndParent = hwnd(#main)
    
    GOSUB [CREATELISTVIEW]
    GOSUB [ADDCOLUMNS]
    
    '**************************************************************************************************
    'add data rows
    LVITEM.mask.struct = LVIF.TEXT
    
    'sample data, i used three spaces to separate each data item
    maxRows=5
    dim rowdata$(maxRows)
    rowdata$(0)="row1   two   three   four   five   six   seven   eight   nine   ten"
    rowdata$(1)="row2   two   three   four   five   six   seven   eight   nine   ten"
    rowdata$(2)="row3   two   three   four   five   six   seven   eight   nine   ten"
    rowdata$(3)="row4   two   three   four   five   six   seven   eight   nine   ten"
    rowdata$(4)="row5   two   three   four   five   six   seven   eight   nine   ten"
    
    maxrow=maxRows-1
    
    'add each row of data
    for row=0 to maxrow
        call addRow row, rowdata$(row)
    next
    '**************************************************************************
    open "MsgHook" for dll as #MsgHook
    hMsgProc = hwnd(#main.GetMsgHookCallback)
    calldll #MsgHook, "TrapMsgFor",hwndLV as ulong, ret as boolean
    calldll #MsgHook, "WatchMsg", hwndLV as ulong, _WM_LBUTTONDBLCLK as long, ret as boolean
    hMsgProc = hwnd(#main.GetMsgHookCallback)
    calldll #user32, "GetWindowLongA",hMsgProc as ulong,_GWL_ID as short,callbackID as long
    calldll #MsgHook, "CreateGetMsgProcHook", hwndParent as ulong, callbackID as long, _
        hMsgProc as ulong, hHook as ulong
    'set timer for checking selected listview row
   
     timer 500, [callsub]
    '*********************************************************************************
   WAIT
    
    ''basic save and load routine.------------------------------------------------
    
[saveList]
    filedialog "Save List","*.txt",saveList$
    if saveList$<>"" then
     open saveList$ for output as #s
     print #s,maxRows
     for s=0 to 5
      print #s,rowdata$(s)
     next s
     close #s
    end if
     notice "List Saved."
    wait
    
[loadList]
    filedialog "Open List View","*.txt",openFile$
    if openFile$<>"" then
        open openFile$ for input as #i
        input #i,maxRows
        redim rowdata$(maxRows) 'max listview rows.
       for i=0 to maxRows
        line input #i,rowdata$(i)
       next i
        close #i
        maxrow=maxRows-1
       'add each row of data
        for row=0 to maxrow
         call addRow row, rowdata$(row)
        next row
    end if
    
    
    '-------------------------------------------------------------------------
    
[loop]
    Wait
    
[callsub]
    
    'call listview1Click ' for future selection using button
    '****************************************************************************************************
    
    
    wait
    
    
    '----------------edit row window
    
    
[editrow]
    timer 0
    WindowWidth = 333 : WindowHeight = 286
    UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
    UpperLeftY = INT((DisplayHeight-WindowHeight)/2)
    
    
    stylebits   #main2.b1, _BS_MULTILINE, 0, 0, 0
    button      #main2.b1, "Save", [saverow], UL, 185, 210, 80, 25
    TextboxColor$ = "White"
    textbox     #main2.t1, 40, 35, 100, 24
    TextboxColor$ = "White"
    textbox     #main2.t2, 40, 70, 100, 24
    TextboxColor$ = "White"
    textbox     #main2.t3, 40, 105, 100, 25
    TextboxColor$ = "White"
    textbox     #main2.t4, 40, 140, 100, 25
    TextboxColor$ = "White"
    textbox     #main2.t5, 40, 175, 100, 25
    TextboxColor$ = "White"
    textbox     #main2.t6, 175, 35, 100, 25
    TextboxColor$ = "White"
    textbox     #main2.t7, 175, 70, 100, 25
    TextboxColor$ = "White"
    textbox     #main2.t8, 175, 105, 100, 25
    TextboxColor$ = "White"
    textbox     #main2.t9, 175, 140, 100, 24
    TextboxColor$ = "White"
    textbox     #main2.t10, 175, 175, 100, 25
    
    Open "Edit Row" for Window as #main2
    #main2 "trapclose [quit2]"
    #main2.t1,word$(rowdata$(LVITEM.iItem.struct),1,"   ")
    #main2.t2,word$(rowdata$(LVITEM.iItem.struct),2,"   ")
    #main2.t3,word$(rowdata$(LVITEM.iItem.struct),3,"   ")
    #main2.t4,word$(rowdata$(LVITEM.iItem.struct),4,"   ")
    #main2.t5,word$(rowdata$(LVITEM.iItem.struct),5,"   ")
    #main2.t6,word$(rowdata$(LVITEM.iItem.struct),6,"   ")
    #main2.t7,word$(rowdata$(LVITEM.iItem.struct),7,"   ")
    #main2.t8,word$(rowdata$(LVITEM.iItem.struct),8,"   ")
    #main2.t9,word$(rowdata$(LVITEM.iItem.struct),9,"   ")
    #main2.t10,word$(rowdata$(LVITEM.iItem.struct),10,"   ")
    
     
« Last Edit: Jul 14th, 2017, 06:08am by metro » User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Eye On SQL
« Reply #8 on: Jul 11th, 2017, 7:22pm »

Part 2
Code:
   
[loop2]
    
    Wait
    
[saverow]
    #main2.t1,"!contents? t1$"
    #main2.t2,"!contents? t2$"
    #main2.t3,"!contents? t3$"
    #main2.t4,"!contents? t4$"
    #main2.t5,"!contents? t5$"
    #main2.t6,"!contents? t6$"
    #main2.t7,"!contents? t7$"
    #main2.t8,"!contents? t8$"
    #main2.t9,"!contents? t9$"
    #main2.t10,"!contents? t10$"
    rowdata$(LVITEM.iItem.struct)=trim$(t1$)+"   "+trim$(t2$)+"   "+trim$(t3$)+"   "+trim$(t4$)+"   "+trim$(t5$)+"   "+trim$(t6$)+"   "+trim$(t7$)+"   "+trim$(t8$)+"   "+trim$(t9$)+"   "+trim$(t10$)
    call updaterow rowdata$(LVITEM.iItem.struct)
    
    goto [quit2]
    wait
    
    
[quit2]
    timer 500, [callsub]
    close #main2
    index=0
    wait
    
[clear]
    wait
    
[delete]
   call deleteRow LVITEM.iItem.struct
   rc=0:r=0:d=0
    while rc<= maxrow
     if rowdata$(rc)<> rowdata$(LVITEM.iItem.struct) then
      rowdata$(r)=rowdata$(rc)
      r=r+1
     else
      d=d+1
     end if
      rc=rc+1
    wend
    maxrow=maxrow-d
   wait
     
[quit]
    timer 0
    calldll #MsgHook, "UnhookMsgHook", hHook as ulong, ret as void
    close #MsgHook
    close #main : END
    
    'subs------------------------------------------------------------------------------------------------
    
sub deleteRow rn
    CallDLL #user32, "SendMessageA", _
      hwndLV As ulong, _
      LVM.DELETEITEM As long, _
      rn As long, _
      LVITEM As struct, _
      r As long
end sub

sub updaterow rd$
    LVITEM.iSubItem.struct = 0
    LVITEM.pszText$.struct =word$(rd$,1,"   ")
    LVITEM.state.struct=1
    calldll #user32, "SendMessageA" , hwndLV as uLong, LVM.SETITEM as Long,_
     0 As Long, LVITEM As struct, re as Long
    for x=1 to columnIndex-1
      LVITEM.iSubItem.struct = x
      LVITEM.pszText$.struct = word$(rd$,x+1,"   ")
      calldll #user32, "SendMessageA" , hwndLV as uLong, LVM.SETITEM as Long,_
      0 As Long, LVITEM As struct, re as Long
    next x
end sub

'------------------------------------
sub addRow row,rd$
    LVITEM.iItem.struct = row
    LVITEM.iSubItem.struct = 0
    LVITEM.pszText$.struct =word$(rd$,1,"   ")
    calldll #user32, "SendMessageA" , hwndLV as uLong, LVM.INSERTITEM as Long,_
     0 As Long, LVITEM As struct, re as Long
   for x=1 to columnIndex-1
     LVITEM.iItem.struct = row
     LVITEM.iSubItem.struct = x
     LVITEM.pszText$.struct = word$(rd$,x+1,"   ")
     calldll #user32, "SendMessageA" ,hwndLV as uLong, LVM.SETITEM as Long,_
     0 As Long, LVITEM As struct, re as Long
    next x
end sub
'--------------------------------------
sub  addColumn name$
    LVCOLUMN.pszText$.struct = name$
    calldll #user32, "SendMessageA" ,hwndLV as uLong, LVM.INSERTCOLUMN as Long,_
    columnIndex as long, LVCOLUMN as Struct, re as Long
    columnIndex=columnIndex+1
end sub


Sub listview1Click
    LVM.GETITEMA = 4101  : LVM.GETITEMCOUNT = 4100
    LVIF.TEXT = 1        : LVM.GETITEMSTATE = 4138
    LVIS.SELECTED = 2    : LVIF.STATE = 8
    'Returns 0-based index of selected item. Call this routine on a timer
    'with resolution of 1000 ms to see which item is selected.
    calldll #user32, "SendMessageA",hwndLV As uLong,  LVM.GETITEMCOUNT as long,_
     0 as long, 0 as long, total As Long
   
    For index = 0 To total-1  'check each row
        LVITEM.mask.struct = LVIF.TEXT Or LVIF.STATE
        LVITEM.iItem.struct = row
        LVITEM.iSubItem.struct = 0  'first column
        LVITEM.cchTextMax.struct = 32
        LVITEM.pszText$.struct = Space$(32)
        LVITEM.stateMask.struct = LVIS.SELECTED
        calldll #user32, "SendMessageA", hwndLV As uLong,  LVM.GETITEMA as long,_
        index as long, LVITEM as struct , re As Long
        state = LVITEM.state.struct 'selected s
        If state And LVIS.SELECTED Then
         Exit For
        End If
    Next
End Sub


[choice] 'determine user selection
       calldll #MsgHook, "GetMsg", msg as struct, ret as void
      'get number of items in list:
    
    CallDLL #user32, "SendMessageA", _
     hwndLV As ulong, _
     LVM.GETITEMCOUNT As long, _
     0 As long, _ 'always 0
     0 As long, _ 'always 0
     total As long
    for index = 0 to total-1 'check each row
     LVITEM.mask.struct = LVIF.TEXT OR LVIF.STATE
     LVITEM.iItem.struct = index 'row
     LVITEM.iSubItem.struct = 0 'first column
     LVITEM.cchTextMax.struct = 32
     LVITEM.pszText$.struct = space$(32)
     LVITEM.stateMask.struct = LVIS.SELECTED
     CallDLL #user32, "SendMessageA", _
      hwndLV As ulong, _
      LVM.GETITEMA As long, _
      index As long, _        'index of row
      LVITEM As struct, _
      r As long
      state = LVITEM.state.struct 'selected state of item
     if state and LVIS.SELECTED then
      txt$=winstring(LVITEM.pszText$.struct)
      goto [editrow]
  '   notice "Selected: ";txt$
     exit for
     end if
    next
      if txt$="" then notice "No selection."
       txt$=""
    wait
    
[CREATELISTVIEW]
    'create listview control
    calldll #comctl32, "InitCommonControls", re as void
    calldll #user32, "GetWindowLongA", hWin as uLong, _GWL_HINSTANCE as long, hInstance as uLong
    
    calldll #user32, "CreateWindowExA", _WS_EX_CLIENTEDGE As long,"SysListView32" as ptr,_
     "" as ptr, style as long,  25 as Long,  25 as Long,  500 as Long,  310 as Long,_
     hWin as uLong, 0 as long, hInstance as uLong,"" as ptr, hwndLV As uLong
    
    calldll #user32, "SendMessageA" , hwndLV as uLong, 4150 as Long,_
     32 As Long, 32 As Long, re as Long    'make listview fullrowselect style
     LVCOLUMN.mask.struct = LVCF.WIDTH OR LVCF.TEXT
     LVCOLUMN.cx.struct = 45 'desired width of column in pixels
 call sendMessage  hwndLV,4150,1,1'SET GRID 
   RETURN
    
[ADDCOLUMNS]
    'add 10 column names, can be changed to match your records comlun names and number of columns

    for c=1 to 10  'add ten columns to the list view
     columnname$="Col";c
    call addColumn columnname$
    next c
    RETURN


function SendMessageLong(hWnd,msg,w,l)
calldll #user32, "SendMessageA", hWnd as ulong, _
msg as long, w as long, l as long,_
SendMessageLong as long
end function

SUB sendMessage  hwndLV , message,wParm ,lParm
    calldll #user32, "SendMessageA",_
        hwndLV as ulong,_
        message as long,_
        wParm as long,_
        lParm as long,_
        re as long
END SUB

 


download for msghook.dll on this post
http://libertybasic.conforums.com/index.cgi?board=api&action=display&num=1497271206
« Last Edit: Jul 14th, 2017, 06:29am by metro » User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Eye On SQL
« Reply #9 on: Jul 12th, 2017, 01:40am »

[ Quote:
These do not work because each table is different and I need to layout the detail page for each table. So it has to be done on the fly. I

Helps if you read the brief properly.
What I added does not help. Sorry
huh
if no other solutions are put forward tsh73 posted this link on another post which could be helpful.

http://justbasic.conforums.com/index.cgi?board=tips&action=display&num=1174689555


« Last Edit: Jul 12th, 2017, 01:49am by metro » User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Re: Eye On SQL
« Reply #10 on: Jul 12th, 2017, 03:35am »

Thanks for the info metro.
I didn't realize that laying out forms in LB was so difficult and rigid.
In my mind something that should be so simple!!

I'm looking into your suggestions for an answer.
If I can find a link between the broswer and LB it would make it really simple.

Funny, haven't heard of any bugs yet. Thought there would be a lot since I pushed the code out early..

Thanks again metro..

User IP Logged

metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Eye On SQL
« Reply #11 on: Jul 12th, 2017, 04:28am »

Quote:
Funny, haven't heard of any bugs yet. Thought there would be a lot since I pushed the code out early..


One I came across early was ...
I load a new DB, click on it once its displayed in the list, then click on the only table I have in that DB. that will display a list of fields. If I click on any one of the fields
and then select the "change" button the table is deleted.

the DB still appears in the list but it is empty.

there's a start for ya

I'll spend a bit more time putting it through its paces..


User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Re: Eye On SQL
« Reply #12 on: Jul 12th, 2017, 10:33am »


Quote:
and then select the "change" button the table is deleted.


Thanks Metro.

Give it a try again.. I think I fixed it. As you know SQLite has no command to Alter Table fields. So the system creates a table backup with the new field. Copies the table stuff to it, Deletes the table, and Renames the backup to the to the table name. Well it did delete the table, but it had a error and didn't rename the backup to the table name.
User IP Logged

Brandon Parker
Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 1118
xx Re: Eye On SQL
« Reply #13 on: Jul 12th, 2017, 6:33pm »

I have not tried your application, but there should be no reason why you cannot dynamically create and/ or edit a Windows ListView using Liberty BASIC to create a similar GUI as metro posted in the image above. Sure it takes some time and getting used to, but if you take your time to learn it the endeavor will be well worth it. Then all you will have to do is encapsulate all of the API calls into handy functions and you'll be off to the races for ListView manipulation.

If you set yourself up well you'll find yourself creating more ListView objects in many more projects since they are very useful for displaying all sorts of information.

{:0)

Brandon Parker
« Last Edit: Jul 12th, 2017, 6:34pm by Brandon Parker » User IP Logged

Windows 7 Home Premium 64-bit Intel(R) Quad Core(TM) i5 CPU M 430 @ 2.27GHz 4GB DDR3 RAM
metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Eye On SQL
« Reply #14 on: Jul 12th, 2017, 8:07pm »

Hi Brandon
Quote:
but there should be no reason why you cannot dynamically create and/ or edit a Windows ListView using Liberty BASIC

by "edit" do you mean the contents of each cell via "(LVITEM.iItem.struct)", if so
would you have any sample code or point me to an example

thanks in advance

Laurie
User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
Pages: 1 2 3  4 Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls