Updated 2011-11-28 00:11:15 by Jorge

Jorge Moreno

My Books: edit

TitleAuthor
Effective Tcl/Tk Programming Brent Welch
Practical Programming in Tcl and Tk Mark Harrison/Michael McLennan
Tcl/Tk for Real Programmers Clif Flynt


Pages I started... edit


when programming with Tcl, I use: edit

for XML parsing

web scrapping

  • tool that helps: firefox add-on that shows tdom structure (DOM Inspector)
  • tool that shows http protocol (HttpFox)

diagrams

WebServer

Static content

driving other windows application

Most used:


Bookmarks: edit


My formatting guide edit

My formatting guide
My quick reference
puts "Tcl is great!"

 puts "did I mention that Tcl is great?"
puts "Tcl/Tk"

Formatting Rules
graffiti

tclODBC + tclhttpd  edit

JM 22 Jul 2011 - I was just playing a little bit with tclhttpd by putting the following code on the file: \htdocs\cgi-bin\test.cgi
 package require tclodbc
 set driver "Microsoft Access Driver (*.mdb)"
 set dbfile "C:\\Program Files\\Microsoft Office\\office11\\samples\\Northwind.mdb"

 puts [html::h3 "getting info from Access through tclODBC..."]
 puts "<table border=1 cellpadding=4>"
 database connect db "DRIVER=$driver;DBQ=$dbfile"

 foreach rec [db "select EmployeeID,LastName,FirstName FROM Employees;"] {
   puts "<tr>"
   foreach field $rec {
     puts "<td>$field</td>"
   }
     puts "</tr>"
 }
 puts "</table>"
 db disconnect

just after the following existing lines:
 puts [html::h1 "Hello, World!"]
 puts [html::h2 [clock format [clock seconds]]]

and I got a dynamic page that queries the database that comes as a sample with the Microsoft Access installation.

you can get there by means of the CGI link on the home page, then through the Sample form posted to test.cgi and finally hitting the "Submit Query" button.