tags:

views:

220

answers:

2

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 is there a simple way to open up X data source send some sql commands and be done with it?

+1  A: 

You can use the "Test Connection" feature after creating the ODBC connection through Control Panel > Administrative Tools > Data Sources.

To test a SQL command itself you could try (not used these myself):

http://www.sqledit.com/odbc/runner.html http://www.sqledit.com/sqlrun.zip

Or (perhaps easier and more useful in the long run) you can make a test ASP.NET or PHP page in a couple minutes to run SQL statement yourself through IIS.

Are you sure you need ODBC and not OLEDB? There is a easy example for a OLEDB .NET connection page here - http://www.w3schools.com/aspnet/aspnet_dbconnection.asp

geographika
I don't want to just test the connection i want to test permissions of some queries. I edited the post to make that clearer.
Rescommunes
Its for other persons software which uses ODBC to connect to mysql so OLE is not really an option... SQL Runner looks like success. Thanks for the help
Rescommunes
A: 

For ad hoc queries, the ODBC Test utility is pretty handy. Its design and interface is more oriented toward testing various parts of the ODBC API. But it works quite nicely for running queries and showing the output. It is part of the Microsoft Data Access Components.

To run a query, you can click the connect button (or use ctrl-F), choose a data source, type a query, then ctrl-E to execute it and ctrl-R to display the results (e.g., if it is a SELECT or something that returns a cursor).

Mark Wilkins
Installed but, search (all folders) failed to find the executable Odbcte32.exe.
Rescommunes
@Rescoummunes: I wonder if they removed it ... I see a few references that say it is in the MDAC. There are other non-microsoft sites that list that as a download, but I would be hesitant to use one of those. Maybe I can poke around more today.
Mark Wilkins
@Rescommunes: I just now followed the link I posted, downloaded mdac28sdk.msi and ran the install on a clean vmware image. It put odbcte32.exe into C:\Program Files\Microsoft Data Access SDK 2.8\Tools\x86.
Mark Wilkins