在Windows上测试ODBC的最简单方法

编程入门 行业动态 更新时间:2024-10-27 07:15:44
本文介绍了在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连接创建快速测试查询的一种方法是使用 DQY 格式.

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的最简单方法

本文发布于:2023-07-05 01:19:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1031295.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:最简单   测试   方法   Windows   ODBC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!