在Windows上测试ODBC的最简单方法 [英] Simplest Way to Test ODBC on WIndows

查看:778
本文介绍了在Windows上测试ODBC的最简单方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用unixODBC,您可以使用一个名为"isql"的简单命令行实用程序来测试某些查询的连接和权限.无需编写额外的代码或安装libs或programs肿的程序,是否有一种简单的方法来打开X数据源并发送一些sql命令并完成它?

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.

推荐答案

在Windows中通过ODBC连接创建快速测试查询的一种方法是使用

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

要实现此目的,请创建一个DQY文件(例如 test.dqy ),其中包含如下所示的魔术前两行(XLODBC和1),然后是第三行的ODBC连接字符串,然后是在第四行上查询(全部在一行上),例如:

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

然后,如果通过双击打开文件,它将在Excel中打开并使用查询结果填充工作表.

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.

这篇关于在Windows上测试ODBC的最简单方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆