Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help connecting to SQL database & creating dynamic toolbar
#2
Macro Macro2833
Code:
Copy      Help
out

;Here I use an Excel file as a database.
;File: $documents$\toolbars.xls
;Sheet: Sheet1
;Data (3 columns):
;Label    Code    Icon
;One    out 1    $qm$\paste.ico
;Two    out 2    

Database db.Open(db.CsExcel("$documents$\toolbars.xls")) ;;if error, close Excel. To see more examples, click word Database and press F1.
ARRAY(str) a; int c
db.QueryArr("SELECT * FROM [Sheet1$]" a) ;;first row is used for headers
str s
for c 0 a.len
,if(a[2 c].len) s+F"{a[0 c]} :{a[1 c]} * {a[2 c]}[]"
,else s+F"{a[0 c]} :{a[1 c]}[]"
;out s
DynamicToolbar s "test34598"


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)