ODBCView Version

ODBCView is a standalone utility that displays data from any ODBC compliant database based on SQL Statements you enter.

Caution: While ODBCView is typically used to view data (ie, SELECT) it can also be used to execute any valid SQL statement. This includes such destructive statements as 'DELETE' and 'DROP TABLE' etc. Therefore extreme care should be used when using this program as updates and

deletes are not reversible. Note some commands may not execute because the database administrator has defined specific user privileges or rights on the database tables. In this case an error message is displayed detailing the database error.                  

Using ODBCView (the quick guide)

To quickly get started using ODBCView follow the steps below.

If you want a more thorough step-by-step guide then see below.

1.      Run the ODBCView program ‘ODBCView.exe’.

2.      Click on the DataSource button and select the required ODBC dataSource using the Select Data Source facility. You can also add a new datasource here if required.

3.      Enter a SQL Statement in the ODBCView window. When ODBCView first opens a datasource it enter a basic SQL SELECT statement displaying a question mark for the table name.

4.      Press the Execute button to execute the current SQL statement. Any records selected from the database are displayed below.

5.      You can press Save to save the SQL Statements to a file name for future searches.

6.      The Clear button will clear the current SQL edit box text.

7.      Export allows you to save the results to a text file in either HTML or CSV format.

8.      Press Exit to close the ODBCView program.

 

Using ODBCView (the more thorough guide)

To use ODBCView, just follow the steps below.

1.      Open the ODBCView program ‘ODBCView.exe’. There will be a splash that will appear briefly, you will then see the ODBCView window. Most of the controls are disabled until you select a datasource except for the Exit button, the Max Rows, and the Data Source button.

 2.      Click on the DataSource button (near the top left of the ODBCView window). You will see a Select Data Source facility similar to the screen below. 

 

       3.      Select one of the existing datasources or add a new datasource if required.

4.      Once you have selected a data source. You will be back to the ODBCView window. You will notice that all of the controls are now active.

5.      You can enter a SQL Statement in the text box (center top). If you look at the screen shot below, you will see that there is a SQL statement being typed.

6.      Once you’ve typed in an SQL statement you can execute it by clicking on the Execute button. Assuming that the SQL statement is valid the results of the executed SQL will be shown in the grid (as demonstrated below). You can specify the maximum number of rows to display in the grid. So if the query (the SQL) is to generate a result that will have more than Max Rows (100 is the default), then the grid will only show up to the Max Rows number.

 

7.      If you find that you repeat an SQL Statement(s) often then you can save your SQL statements to a file. By clicking on the Save button you are prompted with a Save dialog which you can use to specify where you would like to save your query. You can also reopen the file (or open any other SQL script file for that matter) at a later date by using the Open button.

8.      You can start anew by clicking on the Clear button. This will clear any SQL text you may have entered.

9.      If you want to record or save the query results to a text file or html file click on the Export button. This will prompt you with a Save dialog where you can specify where you want to save the results. You can use the File Type on the Save dialog to specify whether you want to save the results as text (CSV) or in HTML format. The export option also uses the Max Rows to limit the records fetched.

10.  Once you’ve finished with ODBCView close it down by clicking on the Exit button.

Using ODBCView from the command line

ODBCView also supports a non-interactive command line mode to execute a query and save the results to a text file. The syntax is as follows:

ODBCView.exe   <DSN=DataSourceName;UID=User;PWD=Password> [<SQLScript.sql>] [<OutputFile.htm|csv|txt>]

Where:

DataSource 

The desired datasource name.

UID

An optional user name to logon to the database

PWD

An optional user password

SQLScript

The query to execute.

OutputFile

The path to the output file. The files extension determines the format. Use htm or html to HTML, csv for CSV.

Note: If you do not provide all three arguments then the main screen is displayed. That is, if you only specify the datasource name then this will automatically connect to the database.