Post by metro on Dec 10, 2010 9:32:39 GMT -5
Hi all
I'm using Dan's SQLite DB Manager to build my project
having trouble working out what is wrong here.
created DB and several tables, table asx100 has 7 fields and 100 records of data
one option within the manager is the ability to run a query on a (Db) table and the the result is displayed in a table.
That works fine but the generated code created generates an error when run
I did have to play around with the original code to make it LINUX friendly replacing "\" with "/"
error is:
can anybody see the obvious, I'm still a noob at programming
thanks in advance
Laurie
I'm using Dan's SQLite DB Manager to build my project
having trouble working out what is wrong here.
created DB and several tables, table asx100 has 7 fields and 100 records of data
one option within the manager is the ability to run a query on a (Db) table and the the result is displayed in a table.
That works fine but the generated code created generates an error when run
dbName$ ="stocks.db3"
sqliteconnect #sql1, "//home/laurie/rb101/stocks.db3"
sql1$ = "SELECT * FROM asx100 LIMIT 0,20"
#sql1 execute(sql1$)
rows = #sql1 ROWCOUNT() 'Get the number of rows
colNames$ = #sql1 columnnames$()
colHdng$ = ""
sep$ = "<TR align=center BGCOLOR=#FFCC99><TD>"
nc = 1
while word$(colNames$,nc,",") <> ""
colHdng$ = colHdng$ + sep$ + word$(colNames$,nc,",")
nc = nc + 1
sep$ = "</TD><TD>"
WEND
nc = nc - 1
cls
html "<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0>"
html "<TR BGCOLOR=#FFCC99 ALIGN=CENTER><TD colspan=";nc;">Database:";dbName$;"</TD></TR>";colHdng$;"</TD></TR>"
WHILE #sql1 hasanswer()
result1$ = #sql1 nextrow$(" |")
code$ = trim$(word$(result1$,1,"|"))
date$ = trim$(word$(result1$,2,"|"))
last$ = trim$(word$(result1$,3,"|"))
open$ = trim$(word$(result1$,4,"|"))
high$ = trim$(word$(result1$,5,"|"))
low$ = trim$(word$(result1$,6,"|"))
volume$ = trim$(word$(result1$,7,"|"))
html "<TR>"
html "<TD>";code$;"</TD>"
html "<TD>";date$;"</TD>"
html "<TD>";last$;"</TD>"
html "<TD>";open$;"</TD>"
html "<TD>";high$;"</TD>"
html "<TD>";low$;"</TD>"
html "<TD>";volume$;"</TD>"
html "</TR>"
WEND
html "</TABLE>"
#sql1 disconnect()
wait
I did have to play around with the original code to make it LINUX friendly replacing "\" with "/"
error is:
Compile Error
Syntax error at line 25: open$ = trim$(word$(result1$,4,"|"))
Open help file.
Syntax error at line 25: open$ = trim$(word$(result1$,4,"|"))
Open help file.
can anybody see the obvious, I'm still a noob at programming
thanks in advance
Laurie