|
| Hi Guys
For those that partecipated to previous "test roundament" here it is another
server to test against.
This time is a machine running Windows 2000 Server SP4 - firewall and router
are more powerful, so it is (or supposed to be) the ADSL line.
Just go to the ODBC connection you already have and change the IP address to
80.181.8.50
This is anoter test server, but it used to be in Florence (the previous one
was in Prato, near Florence) and it is my test machine for dBase
applications.
I'm planning to build some test applications using different solutions to
test against the same database.
The database structure is a s follows:
LOCATION (a list of the streets of Florence)
SEGMENTI (a list of the streets where a stree i diveide into one or more
segments)
OGGETTI (objects inside a segment: an object could be anything - we use it
for tracking signals, traffic lights, road lights and the like)
I have a form to test this (just cut and paste: beware of page breaks)
Feel fre to modify/improve it as much as you want.
********************
*************
parameter bModal
local f
f = new viewForm()
if (bModal)
f.mdi = false // impone non sia MDI
f.readModal()
else
f.open()
endif
class viewForm of FORM
set procedure to gnx-sql2.dmd additive
with (this)
onOpen = class::FORM_ONOPEN
height = 25.1364
left = 29.8571
top = 1.4545
width = 123.4286
text = ""
mdi = false
pageno = 1
endwith
this.DB1 = new FDB()
this.DB1.parent = this
with (this.DB1)
left = 115.0
top = 22.0
endwith
this.SESSION1 = new SESSION()
this.SESSION1.parent = this
with (this.SESSION1)
left = 114.0
top = 22.0
lockRetryInterval = 0
endwith
this.TEXTLABEL1 = new TEXTLABEL(this)
with (this.TEXTLABEL1)
height = 1.0
left = 36.0
top = 8.5
width = 87.0
text = " OGGETTI inside this segment"
colorNormal = "BtnText/0x34e1ef"
fontSize = 9.0
borderStyle = 1 // Rialzato
alignVertical = 1 // Al centro
endwith
this.TEXT2 = new TEXT(this)
with (this.TEXT2)
height = 0.9
left = 0.0
top = 0.0
width = 123.0
colorNormal = "white/0xc08000"
alignVertical = 1 // Al centro
alignHorizontal = 1 // Al centro
text = "MAPPA"
pageno = 5
endwith
this.TEXTLABEL3 = new TEXTLABEL(this)
with (this.TEXTLABEL3)
height = 1.0
left = 0.0
top = 1.0
width = 123.0
text = " LOCATIONS"
colorNormal = "BtnText/0x34e1ef"
fontSize = 9.0
borderStyle = 1 // Rialzato
alignVertical = 1 // Al centro
endwith
this.GRID_LOCS = new GRID(this)
with (this.GRID_LOCS)
onSelChange = class::SQL_UPDATE
fontSize = 8.0
headingFontSize = 8.0
headingFontBold = false
dataLink = form.db1.locs.rowset
columns["COLUMN1"] = new GRIDCOLUMN(form.GRID_LOCS)
columns["COLUMN1"].dataLink = form.db1.locs.rowset.fields["toponimo"]
columns["COLUMN1"].editorType = 1 // EntryField
columns["COLUMN1"].width = 30.2857
columns["COLUMN2"] = new GRIDCOLUMN(form.GRID_LOCS)
columns["COLUMN2"].dataLink = form.db1.locs.rowset.fields["codloc"]
columns["COLUMN2"].editorType = 1 // EntryField
columns["COLUMN2"].width = 8.5714
columns["COLUMN3"] = new GRIDCOLUMN(form.GRID_LOCS)
columns["COLUMN3"].dataLink = form.db1.locs.rowset.fields["keycode"]
columns["COLUMN3"].editorType = 1 // EntryField
columns["COLUMN3"].width = 12.1429
columns["COLUMN4"] = new GRIDCOLUMN(form.GRID_LOCS)
columns["COLUMN4"].dataLink = form.db1.locs.rowset.fields["quartiere"]
columns["COLUMN4"].editorType = 1 // EntryField
columns["COLUMN4"].width = 12.8571
columns["COLUMN5"] = new GRIDCOLUMN(form.GRID_LOCS)
columns["COLUMN5"].dataLink = form.db1.locs.rowset.fields["cap"]
columns["COLUMN5"].editorType = 1 // EntryField
columns["COLUMN5"].width = 11.4286
columns["COLUMN6"] = new GRIDCOLUMN(form.GRID_LOCS)
columns["COLUMN6"].dataLink = form.db1.locs.rowset.fields["map_file"]
columns["COLUMN6"].editorType = 1 // EntryField
columns["COLUMN6"].width = 10.0
columns["COLUMN7"] = new GRIDCOLUMN(form.GRID_LOCS)
columns["COLUMN7"].dataLink = form.db1.locs.rowset.fields["map_title"]
columns["COLUMN7"].editorType = 1 // EntryField
columns["COLUMN7"].width = 17.0
columns["COLUMN8"] = new GRIDCOLUMN(form.GRID_LOCS)
columns["COLUMN8"].dataLink = form.db1.locs.rowset.fields["map_r"]
columns["COLUMN8"].editorType = 1 // EntryField
columns["COLUMN8"].width = 7.1429
columns["COLUMN9"] = new GRIDCOLUMN(form.GRID_LOCS)
columns["COLUMN9"].dataLink = form.db1.locs.rowset.fields["map_c"]
columns["COLUMN9"].editorType = 1 // EntryField
columns["COLUMN9"].width = 7.1429
with (columns["COLUMN1"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN1"].headingControl)
value = "TOPONIMO"
endwith
with (columns["COLUMN2"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN2"].headingControl)
value = "CODLOC"
endwith
with (columns["COLUMN3"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN3"].headingControl)
value = "KEYCODE"
endwith
with (columns["COLUMN4"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN4"].headingControl)
value = "QUARTIERE"
endwith
with (columns["COLUMN5"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN5"].headingControl)
value = "CAP"
endwith
with (columns["COLUMN6"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN6"].headingControl)
value = "MAP_FILE"
endwith
with (columns["COLUMN7"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN7"].headingControl)
value = "MAP_TITLE"
endwith
with (columns["COLUMN8"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN8"].headingControl)
value = "MAP_R"
endwith
with (columns["COLUMN9"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN9"].headingControl)
value = "MAP_C"
endwith
cellHeight = 0.75
rowSelect = true
height = 20.5
left = 0.0
top = 2.0
width = 36.0
endwith
this.GRID_SEGM = new GRID(this)
with (this.GRID_SEGM)
fontSize = 8.0
headingFontSize = 8.0
headingFontBold = false
dataLink = form.db1.segmenti.rowset
columns["Column1"] = new GRIDCOLUMN(form.GRID_SEGM)
columns["Column1"].dataLink =
form.db1.segmenti.rowset.fields["id_segm"]
columns["Column1"].editorType = 1 // EntryField
columns["Column1"].width = 12.0
columns["Column2"] = new GRIDCOLUMN(form.GRID_SEGM)
columns["Column2"].dataLink =
form.db1.segmenti.rowset.fields["desc_segm"]
columns["Column2"].editorType = 1 // EntryField
columns["Column2"].width = 50.0
columns["Column3"] = new GRIDCOLUMN(form.GRID_SEGM)
columns["Column3"].dataLink =
form.db1.segmenti.rowset.fields["codloc"]
columns["Column3"].width = 18.5714
columns["Column4"] = new GRIDCOLUMN(form.GRID_SEGM)
columns["Column4"].dataLink =
form.db1.segmenti.rowset.fields["toponimo"]
columns["Column4"].width = 114.2857
with (columns["Column1"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["Column1"].headingControl)
value = "ID_SEGM"
endwith
with (columns["Column2"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["Column2"].headingControl)
value = "DESC_SEGM"
endwith
with (columns["Column3"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["Column3"].headingControl)
value = "CODLOC"
endwith
with (columns["Column4"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["Column4"].headingControl)
value = "TOPONIMO"
endwith
cellHeight = 0.75
rowSelect = true
height = 3.5
left = 36.0
top = 4.0
width = 87.0
endwith
this.GRID_OGG = new GRID(this)
with (this.GRID_OGG)
fontSize = 8.0
headingFontSize = 8.0
headingFontBold = false
dataLink = form.db1.oggetti.rowset
columns["COLUMN1"] = new GRIDCOLUMN(form.GRID_OGG)
columns["COLUMN1"].dataLink = form.db1.oggetti.rowset.fields["id_ogg"]
columns["COLUMN1"].editorType = 1 // EntryField
columns["COLUMN1"].width = 15.0
columns["COLUMN2"] = new GRIDCOLUMN(form.GRID_OGG)
columns["COLUMN2"].dataLink =
form.db1.oggetti.rowset.fields["cod_amb"]
columns["COLUMN2"].editorType = 1 // EntryField
columns["COLUMN2"].width = 8.0
columns["COLUMN3"] = new GRIDCOLUMN(form.GRID_OGG)
columns["COLUMN3"].dataLink =
form.db1.oggetti.rowset.fields["cod_grp"]
columns["COLUMN3"].editorType = 1 // EntryField
columns["COLUMN3"].width = 8.0
columns["COLUMN4"] = new GRIDCOLUMN(form.GRID_OGG)
columns["COLUMN4"].dataLink =
form.db1.oggetti.rowset.fields["cod_ogg"]
columns["COLUMN4"].editorType = 1 // EntryField
columns["COLUMN4"].width = 8.0
columns["COLUMN5"] = new GRIDCOLUMN(form.GRID_OGG)
columns["COLUMN5"].dataLink =
form.db1.oggetti.rowset.fields["tipo_ogg"]
columns["COLUMN5"].editorType = 1 // EntryField
columns["COLUMN5"].width = 8.0
columns["COLUMN6"] = new GRIDCOLUMN(form.GRID_OGG)
columns["COLUMN6"].dataLink =
form.db1.oggetti.rowset.fields["desc_ogg"]
columns["COLUMN6"].editorType = 1 // EntryField
columns["COLUMN6"].width = 15.0
columns["COLUMN7"] = new GRIDCOLUMN(form.GRID_OGG)
columns["COLUMN7"].dataLink =
form.db1.oggetti.rowset.fields["posiz_ogg"]
columns["COLUMN7"].editorType = 1 // EntryField
columns["COLUMN7"].width = 10.0
columns["COLUMN8"] = new GRIDCOLUMN(form.GRID_OGG)
columns["COLUMN8"].dataLink = form.db1.oggetti.rowset.fields["codcli"]
columns["COLUMN8"].editorType = 1 // EntryField
columns["COLUMN8"].width = 8.0
with (columns["COLUMN1"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN1"].headingControl)
value = "ID_OGG"
endwith
with (columns["COLUMN2"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN2"].headingControl)
value = "COD_AMB"
endwith
with (columns["COLUMN3"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN3"].headingControl)
value = "COD_GRP"
endwith
with (columns["COLUMN4"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN4"].headingControl)
value = "COD_OGG"
endwith
with (columns["COLUMN5"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN5"].headingControl)
value = "TIPO_OGG"
endwith
with (columns["COLUMN6"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN6"].headingControl)
value = "DESC_OGG"
endwith
with (columns["COLUMN7"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN7"].headingControl)
value = "POSIZ_OGG"
endwith
with (columns["COLUMN8"].editorControl)
validErrorMsg = "Dato immesso non valido "
endwith
with (columns["COLUMN8"].headingControl)
value = "CODCLI"
endwith
cellHeight = 0.75
rowSelect = true
height = 13.0
left = 36.0
top = 9.5
width = 87.0
endwith
this.TABBOX1 = new TABBOX(this)
with (this.TABBOX1)
onSelChange = class::TABBOX1_ONSEL
CHANGE
id = 108
height = 1.0
left = 0.0
top = 24.1364
width = 123.4286
dataSource = 'ARRAY {"Main"}'
endwith
this.VAR_KEY = new ENTRYFIELD(this)
with (this.VAR_KEY)
height = 1.0
left = 22.0
top = 1.0
width = 14.0
colorNormal = "lime/black"
value = ""
validErrorMsg = "Dato immesso non valido "
endwith
this.PB_CERCA = new PUSHBUTTON(this)
with (this.PB_CERCA)
onClick = class::PB_CERCA_ONCL
ICK
height = 1.0
left = 36.0
top = 1.0
width = 8.2857
text = "Search"
fontSize = 8.0
speedTip = "Click to search"
borderStyle = 7 // Client
endwith
this.PB_CLEAR_LOCS = new PUSHBUTTON(this)
with (this.PB_CLEAR_LOCS)
onClick = class::PB_CLEAR_LOCS
_ONCLICK
height = 1.0
left = 44.0
top = 1.0
width = 3.0
text = "C"
fontSize = 8.0
speedTip = "Clrar all filters"
borderStyle = 7 // Client
endwith
this.VAR_AUTOUPD = new CHECKBOX(this)
with (this.VAR_AUTOUPD)
onChange = & #123;;class::sql_upd
ate()}
height = 0.5909
left = 107.7143
top = 8.7273
width = 14.1429
text = "Show objects"
colorNormal = "black/0x3fd5ef"
fontSize = 8.0
endwith
this.VAR_TOT_LOCS = new ENTRYFIELD(this)
with (this.VAR_TOT_LOCS)
height = 0.7273
left = 11.7143
top = 1.0909
width = 9.2857
colorNormal = "0x40/0x3fd5ef"
border = false
fontBold = true
value = "000"
validErrorMsg = "Dato immesso non valido "
borderStyle = 3 // Nessuno
endwith
this.VAR_TOT_OGG = new ENTRYFIELD(this)
with (this.VAR_TOT_OGG)
height = 0.7273
left = 37.0
top = 8.6364
width = 5.0
colorNormal = "0x40/0x3fd5ef"
border = false
fontBold = true
value = "000"
validErrorMsg = "Dato immesso non valido "
borderStyle = 3 // Nessuno
endwith
this.TEXTLABEL2 = new TEXTLABEL(this)
with (this.TEXTLABEL2)
height = 1.0
left = 36.0
top = 3.0
width = 87.0
text = " SEGMENTI belonging to "
colorNormal = "BtnText/0x34e1ef"
fontSize = 9.0
borderStyle = 1 // Rialzato
alignVertical = 1 // Al centro
endwith
this.SF_TOPONIMO = new ENTRYFIELD(this)
with (this.SF_TOPONIMO)
dataLink = form.db1.locs.rowset.fields["toponimo"]
enabled = false
height = 0.6364
left = 56.5714
top = 3.1364
width = 27.0
colorNormal = "WindowText/0x3fd5ef"
border = false
validErrorMsg = "Dato immesso non valido "
borderStyle = 3 // Nessuno
endwith
this.ENTRYFIELD1 = new ENTRYFIELD(this)
with (this.ENTRYFIELD1)
dataLink = form.db1.segmenti.rowset.fields["desc_segm"]
enabled = false
height = 0.6364
left = 69.1429
top = 8.6364
width = 37.8571
colorNormal = "WindowText/0x3fd5ef"
border = false
validErrorMsg = "Dato immesso non valido "
borderStyle = 3 // Nessuno
endwith
this.PB_FILTRA = new PUSHBUTTON(this)
with (this.PB_FILTRA)
onClick = class::PB_FILTRA_ONC
LICK
height = 1.0
left = 36.0
top = 2.0
width = 8.2857
text = "Filter"
fontSize = 8.0
speedTip = "Set as filter"
borderStyle = 7 // Client
endwith
this.TEXTLABEL4 = new TEXTLABEL(this)
with (this.TEXTLABEL4)
height = 1.0
left = 22.0
top = 0.0
width = 12.0
text = "Key to search"
fontSize = 8.0
alignVertical = 2 // In basso
alignHorizontal = 1 // Al centro
endwith
//---------------------------------------------------------------------
function form_onOpen
//---------------------------------------------------------------------
form.db1.locs.rowset.first()
class::updateCount()
return
//---------------------------------------------------------------------
function updateCount()
//---------------------------------------------------------------------
form.var_tot_locs.value = form.db1.locs.rowset.count()
form.var_tot_ogg.value = form.db1.oggetti.rowset.count()
return
//---------------------------------------------------------------------
function PB_CERCA_onClick
//---------------------------------------------------------------------
local cKey
cKey = ltrim(rtrim(form.var_key.value))
with (form.db1.locs)
sql = 'Select * from LOCATION WHERE TOPONIMO LIKE "%' + cKey + '%"'
*sql = "SELECT * FROM LOCATION WHERE LOCATION.Toponimo LIKE :pmKey"
*params["pmKey"] = cKey
msgbox(sql)
active = true
rowset.first()
endwith
form.grid_locs.refresh()
return
//---------------------------------------------------------------------
function PB_CLEAR_LOCS_onClic
k
//---------------------------------------------------------------------
with (form.db1.locs)
sql = 'Select * from LOCATION WHERE SERVICE = ""'
active = true
rowset.first()
endwith
form.grid_locs.refresh()
return
//---------------------------------------------------------------------
function PB_FILTRA_onClick
//---------------------------------------------------------------------
local cKey
cKey = upper(ltrim(rtrim(fo
rm.var_key.value)))
with (form.db1.locs)
sql = 'Select * from LOCATION'
active = true
rowset.first()
endwith
with (form.db1.locs.rowset)
beginFilter()
filter = "TOPONIMO='" + cKey + "'"
msgbox(filter)
applyFilter()
first()
endwith
form.grid_locs.refresh()
return
//---------------------------------------------------------------------
function sql_update
//---------------------------------------------------------------------
class::sql_segm()
if form.var_autoupd.value
class::sql_ogg()
endif
class::updateCount()
return
//---------------------------------------------------------------------
function TABBOX1_onSelChange
//---------------------------------------------------------------------
form.pageNo = form.tabbox1.cursel
return
//---------------------------------------------------------------------
function sql_ogg
//---------------------------------------------------------------------
local cKey
cKey = rtrim(ltrim(form.db1.segmenti.rowset.fields["id_segm"].value))
with (form.db1.oggetti)
sql = 'Select * from OGGETTI WHERE OGGETTI.ID_SEGM = "' + cKey + '"'
active = true
rowset.first()
endwith
form.grid_ogg.refresh()
return
//---------------------------------------------------------------------
function sql_segm
//---------------------------------------------------------------------
local cKey
cKey = rtrim(ltrim(form.db1.locs.rowset.fields["codloc"].value))
with (form.db1.segmenti)
sql = 'Select * from SEGMENTI WHERE SEGMENTI.CODLOC = "' + cKey + '"'
active = true
rowset.first()
endwith
form.grid_segm.refresh()
return
endclass
********************
***********
* DATAMODULE
********************
***********
** END HEADER -- non togliere questa linea
//
// Generato il 26/08/2005
//
class FDB of DATAMODULE
with (this)
left = -1.0
top = -1.0
endwith
this.GNX = new DATABASE()
this.GNX.parent = this
with (this.GNX)
left = 19.0
top = 135.0
width = 115.0
height = 112.0
databaseName = "GNX"
active = true
endwith
this.LOCS = new QUERY()
this.LOCS.parent = this
with (this.LOCS)
left = 43.0
top = 227.0
width = 114.0
height = 117.0
database = form.gnx
*sql = 'Select * from "LOCATION"'
*active = true
sql = 'select * from LOCATION WHERE SERVICE = ""'
params["pmKey"] = "---"
active = true
endwith
this.HISTORY = new QUERY()
this.HISTORY.parent = this
with (this.HISTORY)
left = 661.0
top = 225.0
width = 114.0
height = 117.0
database = form.gnx
sql = 'Select * from "HISTORY" WHERE SERVICE = ""'
active = true
endwith
this.OGGETTI = new QUERY()
this.OGGETTI.parent = this
with (this.OGGETTI)
left = 438.0
top = 224.0
width = 114.0
height = 117.0
database = form.gnx
sql = 'Select * from "OGGETTI" WHERE SERVICE = ""'
active = true
endwith
this.SEGMENTI = new QUERY()
this.SEGMENTI.parent = this
with (this.SEGMENTI)
left = 246.0
top = 226.0
width = 114.0
height = 117.0
database = form.gnx
sql = 'Select * from "SEGMENTI" WHERE SERVICE = ""'
active = true
endwith
endclass
********************
Once again be my guests.
GN
|
|