Tintware Documentation : Tint Automation Client : Access Example : Access Example Source To run this code, you will have to copy it into a file and load the file in Tint Emacs. Use M-x eval-current-buffer to compile the code. Def:Proc:access(%filename) [*] #(def?,oleauto.new-object,,( #(tint.ignore,#(tint.library,debug/toac)) )) #(access.access,#(oleauto.new-object,access.application.9),%filename) [*] Def:Proc:access.access(%access,%filename) [*] #(%access.NewCurrentDatabase,%filename) #(access.database,#(%access.CurrentDb)) #(%access.ADOConnectString.get) #(%access.Quit,acQuitSaveAll) #(undef,%access) [*] Def:Proc:access.database(%db) [*] #(access.tables,%db,#(%db.TableDefs.get)) [*] Def:Proc:access.tables(%db,%ctd) [*] #(access.new-table,#(%db.CreateTableDef),%ctd,TintStrings) #(access.new-table,#(%db.CreateTableDef),%ctd,TintProcedures) #(access.new-table,#(%db.CreateTableDef),%ctd,TintContainers) #(undef,%ctd) #(undef,%db) [*] Def:Proc:access.TintStrings(%td,%cfd) [*] #(access.new-field,%td,Name,text,128,%cfd) #(access.new-field,%td,Body,text,255,%cfd) #(access.new-field,%td,Offset,integer,0,%cfd) #(access.new-field,%td,Attribute,text,32,%cfd) [*] Def:Proc:access.TintProcedures(%td,%cfd) [*] #(access.new-field,%td,Name,text,128,%cfd) #(access.new-field,%td,Body,text,255,%cfd) [*] Def:Proc:access.TintContainers(%td,%cfd) [*] #(access.new-field,%td,Name,text,128,%cfd) #(access.new-field,%td,Type,text,32,%cfd) [*] Def:Proc:access.TintArrays(%td,%cfd) [*] #(access.new-field,%td,Name,text,128,%cfd) #(access.new-field,%td,Children,integer,0,%cfd) [*] Def:Proc:access.new-table(%td,%ctd,%name) [*] #(%td.Name.put,%name) #(access.new-table.do,%td,#(%td.Fields.get),%name) #(%ctd.Append,%td) #(undef,%td) [*] Def:Proc:access.new-table.do(%td,%cfd,%name) [*] #(access.%name,%td,%cfd) #(undef,%cfd) [*] Def:Proc:access.new-field(%td,%name,%type,%size,%cfd) [*] #(access.new-field.do,#(%td.CreateField,%name,#(access.fieldtype.%type),%size), %cfd) [*] Def:Proc:access.new-field.do(%fd,%cfd) [*] #(%cfd.Append,%fd) #(undef,%fd) [*] Def:Dict:access.fieldtype Def:String:access.fieldtype.yes-no [*]1[*] Def:String:access.fieldtype.byte [*]2[*] Def:String:access.fieldtype.integer [*]3[*] Def:String:access.fieldtype.long-integer [*]4[*] Def:String:access.fieldtype.currency [*]5[*] Def:String:access.fieldtype.single [*]6[*] Def:String:access.fieldtype.double [*]7[*] Def:String:access.fieldtype.date-time [*]8[*] Def:String:access.fieldtype.binary [*]9[*] Def:String:access.fieldtype.text [*]10[*] Def:String:access.fieldtype.ole-object [*]11[*] Def:String:access.fieldtype.memo [*]12[*] |