From: iODBC M. <io...@op...> - 2008-04-22 22:57:10
|
Hi Nima, > > Thank you for your prompt reply, I have two more questions: > > Would you explain a bit more about "DSN less connections"? if my > clients have their own Dbs, still I can use this option? > Well basically a DSN-less connection is a connection you can make without first registering a DSN in odbc.ini (or even a driver in odbcinst.ini) This is an option that can be used with the SQLDriverConnect call. Normally you would make a connection with: DSN=testdsn;UID=test;PWD=testing where the driver manager will lookup the name testdsn from the odbc.ini file and use the driver registered in that section. This driver then checks the [testdsn] section for any other connection parameters it needs. With an DSN-less connection you do not provide a DSN= but a DRIVER= string e.g.: DRIVER=/Application/TestApp/Driver.so;UID=test;... In this case you need to provide ALL the options needed for the connection in this string as there is no odbc.ini or odbcinst.ini section it can use to read the rest of its connection parameters. Since your customers may want to use your plugin within their own database/settings, the DSN-less connection might not be the best way for your needs. > > Also I installed a ODBCS driver and set a DataSource on my Mac with > ODBC Administrator.app. How can I test connectivity, see the databases > available? query on tables? Is any shareware or free > software available for these on Mac? You can use the iodbctest program provided on the Mac from a Terminal screen e.g.: iodbctest "DSN=test;UID=tester;PWD=testpw" Note the quotes (") around the connection string to prevent the shell from thinking you are starting another command. The iodbctest program uses the SQLDriverConnect function to make the connection. At the SQL> prompt you can enter a SQL statement like: SELECT * from table There are also some meta commands to get a list of tables etc. Please read: man iodbctest for a full description of what this program can do. Best regards, Patrick |