C/ODBC & SQL

I’m having a problem getting an ASP.NET component to talk to a database through an ODBC connection. It has me really frustrated!!! The application is a combination of classic ASP and ASP.NET over a SQL Server 2000 backend. I recently developed some code that would write data to a Navision database at discrete events. The application would write the data over an ODBC connection. One event that writes information to the Navision database is in an ASP component. Actually, the ASP page calls a VB.NET application to perform the transaction. That works fine. Two other events that write information to the Navision database are in the ASP.NET portion of the application. They are both called from the same data layer dll. I developed all of this on an XP machine and rolled it out to a test server with Windows 2000. All ODBC transactions worked fine on both of these machines. However, the events in the ASP.NET page didn’t work on our production server (Windows 2000 Server) and I have no idea what the problem is. It just stops on the command to open the connection. There are no messages in the event log, no error messages anywhere, nothing… Here are some things I’ve examined: 1) The DCOM permissions are the same 2) The “out-of-process” settings in IIS are the same 3) The security settings for the ASPNET user are the same 4) The security settings on the directories are the same I did one of the transactions on the test server and on the production server with the following monitoring software running on each: RegMon, FileMon, ODBC tracing, and Process Explorer. Here’s a summary of what I saw: RegMon – There are similar transactions for ASPNET in both down through setting up the ODBC data source. However, there are additional transactions on the test machine (mainly TCP/IP and cryptography). No errors or warnings in the RegMon log on the production machine. FileMon - Again, the two machines were similar up through connection setup. However, the test machine had several more file access attempts, mostly to C:\Program Files\Microsoft Business Solutions-Navision\Client\nc_tcp.DLL and C:\WINNT\System32\drivers\etc\services. Again, no errors or warning on the production server. ODBC Tracing – Similar activity on both, but more so on the test server. The information in the log file was not very helpful in diagnosing problem. Process Explorer – No help. Nothing unusual noted. I need to get this resolved ASAP. I have users that need to do many financial transactions in the next two days, and I’m stuck. (And I’m the only developer!) Any suggestions or possible tools to use in diagnosing problem would be GREATLY appreciated!!!

It’s very simple: C/ODBC is NOT supported under the SQL database, only the native. You’ll have to wait till they release 4.00 to get this. [:(]

4.0 has a new C/ODBC driver (NODBC) which, as with C/ODBC, is a driver for the native Navision Server - it is not a driver for SQL Server - it is not a multiplexer. For SQL Server, the SQL Server ODBC driver is still used. So no change there. It does, however, support the “OLEDB Provider for ODBC”, which is what is under all this ADO.NET stuff when you use an ODBC driver, and that is the heart of the current problems with C/ODBC.

Let me clarify a bit. The backend for the ASP.NET application is SQL Server. At dicrete events, data is read from the SQL Server database and written over to Navision through the C/ODBC connection. Navision is still in C/SIDE. The problem occurs when I try to write information to Navision from an ASP.NET page. It just hangs. At another event on a classic ASP page, a VB.NET application that writes information across the same C/ODBC connection is fired off. That works fine. Also, I have another VB.NET application that runs as a job that is scheduled under the SQL Server Agent. This application also successfully writes across the C/ODBC connection. The only one that hangs is the ASP.NET page. I suspected a permissions issue since the ASP.NET page runs under the aspnet worker process. The VB.NET application running under the ASP page runs under the IUSR user. And the scheduled job runs under the sqlagent user. But I cannot find any security setting with the aspnet user that fixes the problem.

Very common problem :slight_smile: ASP works, but ASP.Net doesn’t. IUSR_xxx security is set properly, but guess what, you have an extra User account to deal with: ASPNET. Read up on ASP.net, it uses a different anonymous account.

quote:


Originally posted by blaflin
Let me clarify a bit. The backend for the ASP.NET application is SQL Server. At dicrete events, data is read from the SQL Server database and written over to Navision through the C/ODBC connection. Navision is still in C/SIDE. The problem occurs when I try to write information to Navision from an ASP.NET page. It just hangs. At another event on a classic ASP page, a VB.NET application that writes information across the same C/ODBC connection is fired off. That works fine. Also, I have another VB.NET application that runs as a job that is scheduled under the SQL Server Agent. This application also successfully writes across the C/ODBC connection. The only one that hangs is the ASP.NET page. I suspected a permissions issue since the ASP.NET page runs under the aspnet worker process. The VB.NET application running under the ASP page runs under the IUSR user. And the scheduled job runs under the sqlagent user. But I cannot find any security setting with the aspnet user that fixes the problem.


quote:


Originally posted by robertc
4.0 has a new C/ODBC driver (NODBC) which, as with C/ODBC, is a driver for the native Navision Server - it is not a driver for SQL Server - it is not a multiplexer. For SQL Server, the SQL Server ODBC driver is still used. So no change there.


That’s really bad news and not quite what MBS in Minneapolis announced on MBS Tech 2003. [:(]