Simplest Way to Test ODBC on WIndows

后端 未结 6 1673
暖寄归人
暖寄归人 2020-12-14 00:25

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 instal

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 01:08

    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.

提交回复
热议问题