|
| 1 | +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 5 | + <meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.11 i586) [Netscape]"> |
| 6 | +</head> |
| 7 | +<body bgcolor="#FEFEDF"> |
| 8 | + |
| 9 | +<h2> |
| 10 | +PgAccess developer API</h2> |
| 11 | + |
| 12 | +<hr> |
| 13 | +<br>Starting with PgAccess 0.98 I am planning to make available a complete |
| 14 | +API for the PgAccess developers. I plan to make PgAccess not just an administrative |
| 15 | +tool, but also a tool for easy build of small applications. |
| 16 | +<p>That's why PgAccess 0.98 has been internally restructured, every main |
| 17 | +module of PgAccess has became a namespace (see Tcl namespaces) in order |
| 18 | +to hide the variables and internal procedures to the user. Also, all the |
| 19 | +global variables that have been used before were grouped under a single |
| 20 | +big associative array called <b>PgAcVar</b> (PgAccess variables) so they |
| 21 | +should not interfere with user defined global variables. |
| 22 | +<br> |
| 23 | +<br> |
| 24 | +<p><b><font size=+1>Global variables available</font></b> |
| 25 | +<br> |
| 26 | +<center><table BORDER=0 WIDTH="100%" NOSAVE > |
| 27 | +<tr NOSAVE> |
| 28 | +<td ALIGN=LEFT VALIGN=TOP NOSAVE><b>PgAcVar</b></td> |
| 29 | + |
| 30 | +<td>The main global associative array that hold together various information |
| 31 | +needed by PgAccess. User should <b><font color="#FF0000">NOT</font></b> |
| 32 | +alter it under any circumstances.</td> |
| 33 | +</tr> |
| 34 | + |
| 35 | +<tr NOSAVE> |
| 36 | +<td VALIGN=TOP NOSAVE><b>CurrentDB</b></td> |
| 37 | + |
| 38 | +<td>The handler of the current opened database. Can be used for database |
| 39 | +operations as selects or command execution.</td> |
| 40 | +</tr> |
| 41 | + |
| 42 | +<tr NOSAVE> |
| 43 | +<td ALIGN=LEFT VALIGN=TOP NOSAVE><b>Messages</b></td> |
| 44 | + |
| 45 | +<td NOSAVE>The associative array that holds the translation for the current |
| 46 | +language. Loaded from the appropriate language file from lib/languages |
| 47 | +directory</td> |
| 48 | +</tr> |
| 49 | + |
| 50 | +<tr NOSAVE> |
| 51 | +<td ALIGN=LEFT VALIGN=TOP NOSAVE><b>PGACCESS_HOME</b></td> |
| 52 | + |
| 53 | +<td>Keep the system directory of PgAccess root installation</td> |
| 54 | +</tr> |
| 55 | +</table></center> |
| 56 | + |
| 57 | +<br> |
| 58 | +<p><b><font size=+1>Window naming convention</font></b> |
| 59 | +<p>Every toplevel window defined by PgAccess has the following naming convention. |
| 60 | +Every window name starts with <tt>.pgaw</tt> (PgAccess window) followed |
| 61 | +by a colon and a name. <i>Example:</i> |
| 62 | +<blockquote><tt>.pgaw:User , .pgaw:About , .pgaw:ImportExport</tt></blockquote> |
| 63 | +<b><font size=+1>Namespaces available</font></b> |
| 64 | +<p>For every tab from the main database window there is a namespace defined |
| 65 | +(Tables, Queries, Views, Functions, Sequences, Reports, Forms, Scripts, |
| 66 | +Users, Schema). Every namespace has by default the following procedures: |
| 67 | +<ul> |
| 68 | +<li> |
| 69 | +<tt>new</tt> , no parameter needed</li> |
| 70 | + |
| 71 | +<li> |
| 72 | +<tt>open</tt> , need a single parameter, the object name</li> |
| 73 | + |
| 74 | +<li> |
| 75 | +<tt>design</tt> , need a single parameter, the object name</li> |
| 76 | +</ul> |
| 77 | +You can use these procedures if you want to produce the same efects as |
| 78 | +clicking on the desired tab and then on the "New", "Open" or "Design" buttons |
| 79 | +from the main database window. |
| 80 | +<br><i>Example:</i> |
| 81 | +<blockquote><tt>Tables::open "customers"</tt> |
| 82 | +<br><tt>Queries::open "Invoices received"</tt> |
| 83 | +<br><tt>Forms::open "Add new invoice"</tt></blockquote> |
| 84 | +The <tt>Tables::open</tt> procedure accepts two optional parameters, filter |
| 85 | +and order. |
| 86 | +<br><i>Example:</i> |
| 87 | +<blockquote><tt>Tables::open "phonebook" "name ~* 'joe'" "age desc"</tt></blockquote> |
| 88 | +will open a table view window with predefined filter "name ~* 'joe'" and |
| 89 | +ordered by descending age. |
| 90 | +<p>There is also a special namespace called Database. Here are some |
| 91 | +procedures and functions defined for this namespace available to the user: |
| 92 | +<br> |
| 93 | +<table BORDER NOSAVE > |
| 94 | +<tr BGCOLOR="#FFCCFF" NOSAVE> |
| 95 | +<td NOSAVE><b>Name</b></td> |
| 96 | + |
| 97 | +<td NOSAVE><b>Parameters</b></td> |
| 98 | + |
| 99 | +<td><b>Type</b></td> |
| 100 | + |
| 101 | +<td><b>Returns</b></td> |
| 102 | + |
| 103 | +<td NOSAVE><b>Description</b></td> |
| 104 | +</tr> |
| 105 | + |
| 106 | +<tr> |
| 107 | +<td><b>vacuum</b></td> |
| 108 | + |
| 109 | +<td>none</td> |
| 110 | + |
| 111 | +<td>procedure</td> |
| 112 | + |
| 113 | +<td>nothing</td> |
| 114 | + |
| 115 | +<td>vacuums the current database</td> |
| 116 | +</tr> |
| 117 | + |
| 118 | +<tr ALIGN=LEFT VALIGN=TOP NOSAVE> |
| 119 | +<td><b>getTablesList</b></td> |
| 120 | + |
| 121 | +<td>none</td> |
| 122 | + |
| 123 | +<td>function</td> |
| 124 | + |
| 125 | +<td>list</td> |
| 126 | + |
| 127 | +<td NOSAVE>returns the list of tables from the current database</td> |
| 128 | +</tr> |
| 129 | + |
| 130 | +<tr ALIGN=LEFT VALIGN=TOP NOSAVE> |
| 131 | +<td><b>executeUpdate</b></td> |
| 132 | + |
| 133 | +<td>sqlcmd</td> |
| 134 | + |
| 135 | +<td>function</td> |
| 136 | + |
| 137 | +<td>integer</td> |
| 138 | + |
| 139 | +<td NOSAVE>execute the sqlcmd command on the current database returning |
| 140 | +1 if no errors ocurred or 0 if the command failed</td> |
| 141 | +</tr> |
| 142 | +</table> |
| 143 | + |
| 144 | +<p><b><font size=+1>Global functions available</font></b> |
| 145 | +<br> |
| 146 | +<table BORDER NOSAVE > |
| 147 | +<tr BGCOLOR="#99FFCC" NOSAVE> |
| 148 | +<td><b>Name</b></td> |
| 149 | + |
| 150 | +<td><b>Parameters</b></td> |
| 151 | + |
| 152 | +<td NOSAVE><b>Description</b></td> |
| 153 | +</tr> |
| 154 | + |
| 155 | +<tr ALIGN=LEFT VALIGN=TOP NOSAVE> |
| 156 | +<td><b>setCursor</b></td> |
| 157 | + |
| 158 | +<td>type</td> |
| 159 | + |
| 160 | +<td NOSAVE>Set the cursor for all PgAccess windows, type of cursor can |
| 161 | +be WAIT or CLOCK or WATCH for the hourglass , anything else (or none) to |
| 162 | +return to the normal cursor shape</td> |
| 163 | +</tr> |
| 164 | + |
| 165 | +<tr ALIGN=LEFT VALIGN=TOP NOSAVE> |
| 166 | +<td><b>parameter</b></td> |
| 167 | + |
| 168 | +<td>msg</td> |
| 169 | + |
| 170 | +<td NOSAVE>Shows a modal input dialog with the msg message, wait for user |
| 171 | +to enter the data and returns it as a string</td> |
| 172 | +</tr> |
| 173 | + |
| 174 | +<tr> |
| 175 | +<td><b>showError</b></td> |
| 176 | + |
| 177 | +<td>msg</td> |
| 178 | + |
| 179 | +<td>Shows a modal dialog window with an error message</td> |
| 180 | +</tr> |
| 181 | + |
| 182 | +<tr> |
| 183 | +<td></td> |
| 184 | + |
| 185 | +<td></td> |
| 186 | + |
| 187 | +<td></td> |
| 188 | +</tr> |
| 189 | + |
| 190 | +<tr> |
| 191 | +<td></td> |
| 192 | + |
| 193 | +<td></td> |
| 194 | + |
| 195 | +<td></td> |
| 196 | +</tr> |
| 197 | + |
| 198 | +<tr> |
| 199 | +<td></td> |
| 200 | + |
| 201 | +<td></td> |
| 202 | + |
| 203 | +<td></td> |
| 204 | +</tr> |
| 205 | + |
| 206 | +<tr> |
| 207 | +<td></td> |
| 208 | + |
| 209 | +<td></td> |
| 210 | + |
| 211 | +<td></td> |
| 212 | +</tr> |
| 213 | + |
| 214 | +<tr> |
| 215 | +<td></td> |
| 216 | + |
| 217 | +<td></td> |
| 218 | + |
| 219 | +<td></td> |
| 220 | +</tr> |
| 221 | + |
| 222 | +<tr> |
| 223 | +<td></td> |
| 224 | + |
| 225 | +<td></td> |
| 226 | + |
| 227 | +<td></td> |
| 228 | +</tr> |
| 229 | +</table> |
| 230 | + |
| 231 | +</body> |
| 232 | +</html> |
0 commit comments