Command line options:
- -h or --help
- Shows a little help.
- --short=integer
- Used to define as integer (number) the maximum output length for fields shown in database, and so possibly speed up the process if there exist long fields like memo or longbinary in a given table.
- --html
- Produces output in HTML format instead of default CSV (Comma Separated Values, RFC 4180).
- --bin
- Produces output of binary fields in C escapes format.
- --stdin
- Used to specify that input for SQL commands is standard input instead of command line. This is useful if you want to include a double quote (") in a given SQL command, since double quotes are trimmed by the wscript engine (ask Microsoft...). If you use unicode version of the program consider that you must encode standard input in unicode, obviously.
- --pwd=password
- Allows to specify as data protection password the given one, used to create a new database with it or read one that has it assigned.
- --encrypt
- To generate encrypted databases.
- --repair
- To (try) repair database.
- --compact
- To (try) compact database.
Let's go to some examples:
A "trivial" one:
youaccess mydatabase "SELECT * FROM [mytable]"
It outputs something like:
"id", "text" "1", "hola" "2", "que" "5", "tal"
A simple one (outputs html and limits field output length to 40 characters):
youaccess ---html -short=40 mydatabase "SELECT * FROM [mytable]" > mytable.html
Is recommended to put table names and field names between brackets, for example, to prevent collision with internal (reserved) SQL identifiers.
A more complex one, but doing the same thing as previous one, with reading from standard input (substitute echo SELECT * FROM gh with type file where file is a file name with the SQL command, to perceive a more realistic and dramatic approach):
echo SELECT * FROM [mytable] | youaccess --html --short=40 --stdin mydatabase > mytable.html
Both result in this output (saved in file mytable.html), with a somewhat simplistic table:
id | text |
---|---|
1 | hola |
2 | que |
5 | tal |
About character encoding:
youaccess outputs in a charset fashion following of your OS configuration. Usually (at least in western OSes) is codepage 850, also known as CP850, CP 850, 850, CP-850, IBM-850 or something similar.
youaccess_unicode outputs using unicode, as its name indicates, more exactly UTF-16 (little endian), at least in my OS configuration (Windows XP, western language).
About binary and null fields:
Binary fields are printed out (when --bin option is specified) using the classic format of C programming language, that is, as the integer value of each byte preceded by backslash. For example, to represent byte value 0:
\0
...or to represent the ASCII string 'hola':
\104\111\108\97
Binary fields (when --bin option is not used) and null valued fields, come unquoted in CSV (default) format as <Binary> and <Null>, respectively. This allows some flexibilty in its use (postprocesing using a programming language, for example) with the objective of being more precise at management of different types of data values.
About output format:
Take into consideration that the default output format for SQL queries that return results is CSV, that is Comma Separated Values, to try to maximize compatibility. This means that in our case values of table fields go between double quotes and separated by commas, and that double quotes inside them are expressed repeating them, that is, this is a double quote: " and this is a double quote in CSV: "". So, as a synopsis, a double quote in CSV is a double double quote.
License:
YouAccess is donationware, being its source code public domain.
That means you must make a donation to adquire the rights to use the software. The donations can be done via PayPal (www.paypal.com) or via SourceForge (http://sourceforge.net/projects/youaccess). PayPal is the preferred way, making the donation to the following address:
ignacio_javier_igjav@yahoo.comOr directly using the following link.
Nothing more. Greetings and enjoy the app.