Read table in SQL-Database via ODBC

Hi all, I need to read certain tables from a 3.60 database on SQL server via ODBC. I created a DSN with the MS-SQL driver to access the database, and the application which uses this DSN (a DMS called Saperion) can open the connection and shows me the tables, fields and so on. But when it comes to read the records, i got a error for the SQL statement CreateDB(DB=MyTable, DBH=7). So I tried to use the Navision ODBC driver, but I can’t even open the dialog for selecting the company, because I should enter username and password, but SQL server is configured for using windows autentification. Entering a user which is allowed to acces the database didn’t work, but I get no errors. So what’s to do? Which driver should I use, and where is the error in this scenario? When using a access database and the access driver everything works fine. Thanks, Alex

To access SQL Server you need the SQL Server ODBC driver not the Navision Server driver, C/ODBC. So your are correct with what you tried to do first. But is that all the error message you get? Usually, an ODBC-application will give full ODBC error when receiving and error from SQLGetDiagRec() etc - like “[Microsoft][SQL Server ODBC Driver][SQL Server]State: HY000: You messed up!”. You could try running an ODBC trace before running your application. This will dump all ODBC calls to a file and should give you the error information. Do this in the ODBC Driver Manager from Administrative Tools, ODBC Data Sources. There is a Tracing tab. You give a trace file name and start tracing. Then run your app until you get the error. Then stop tracing. Lastly, open the log file and see if a full error messages (near the end) is listed.

I’ll get some error log as you advised, but now I know that using the MS-SQL driver should work and the error is somewhere else. Thanks, Alex