Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplest Way to Test ODBC on WIndows

Tags:

odbc

With unixODBC you can use a simple command line utility called "isql" to test your connection and permissions of some queries. Without having to write extra code or install libs or bloated programs, is there a simple way to open up X data source send some sql commands and be done with it?

Doing this on the command line would be preferable.

like image 406
Rescommunes Avatar asked Apr 24 '10 00:04

Rescommunes


People also ask

How do I know if my ODBC connection is working?

Create an ODBC data source as described in Configuring ODBC User and System Client Data Sources, specifying the TCP/IP address and TCP/IP port of the OpenAccess SDK service. Click the Test Connect button to test the connection. If successful, a dialog appears telling you the connection was successful.

How do I check my ODBC driver Windows 10?

To check the ODBC SQL Server driver version (32-bit ODBC)In the ODBC Data Source Administrator, click the Drivers tab. Information for the Microsoft SQL Server entry is displayed in the Version column.


1 Answers

One way to create a quick test query in Windows via an ODBC connection is using the DQY format.

To achieve this, create a DQY file (e.g. test.dqy) containing the magic first two lines (XLODBC and 1) as below, followed by your ODBC connection string on the third line and your query on the fourth line (all on one line), e.g.:

XLODBC 1 Driver={Microsoft ODBC for Oracle};server=DB;uid=scott;pwd=tiger; SELECT COUNT(1) n FROM emp 

Then, if you open the file by double-clicking it, it will open in Excel and populate the worksheet with the results of the query.

like image 101
Josh Bode Avatar answered Sep 22 '22 02:09

Josh Bode