Informix and NT IIS problem
Posted in 1997
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Connectivity: ODBC / JDBC / .NET, Server Administration, Security, Permissions & Auditing
Hello all, I am now using Chinese Windows NT (Taiwan) Build 1381 and IIS (Internet Information Server) 3.0 with ASP (active server server page) as our webserver. We are now using: connect_9.12.TC2.exe as ODBC driver to connect to Informix Our business is selling books on the web. The front end (web, display part) is Access database and the backend (inventory control) is Informix. I write an ASP program on the front end (by ASP) to let non-computer people (editor, product admin) to add and alter the book database. And the program also update the database in Informix as well. Below is the ASP code (update_book.asp): <% 'Get data from previous form product_no= trim(request.form("product_no")) product_title=trim(request.form("book_title_c")) product_author=trim(request.form("author")) product_publisher=trim(request.form("publisher")) product_vendor=trim(request.form("vendor")) product_punit=trim(request.form("p_unit")) 'This part cut, update the Access database, no problem 'start update the informix database sql="UPDATE product SET product.prd_desc = '" & product_title & "' , product.prd_author = '" & product_author & "' , prd_publisher = '" & product_publisher & "' WHERE product.prd_prd_id = '" & product_no & "'" set ifx_product = Server.CreateObject("ADODB.RecordSet") ifx_product.Open sql,"dsn=CBC_ORDER_I;uid=<userid>;pwd=<passwd>", 3,3 set ifx_product = Nothing sql="select distinct vdr_no from vendor where vdr_name = '" & product_vendor & "'" set ifx_vendor = Server.CreateObject("ADODB.RecordSet") ifx_vendor.Open sql,"dsn=CBC_ORDER_I;uid=<userid>;pwd=<passwd>",1,1 if not(ifx_vendor.eof) then vendor_no=ifx_vendor("vdr_no") end if set ifx_vendor = Nothing sql="UPDATE vendor_filter SET vendor_filter.vdf_vdr_no = " & vendor_no & " WHERE vendor_filter.vdf_prd_id = '" & product_no & "'" set ifx_vendor_f = Server.CreateObject("ADODB.RecordSet") ifx_vendor_f.Open sql,"dsn=CBC_ORDER_I;uid=<userid>;pwd=<passwd>", 3,3 set ifx_vendor_f = Nothing sql="select distinct put_no from punit where put_name = '" & product_punit & "'" set ifx_punit = Server.CreateObject("ADODB.RecordSet") ifx_punit.Open sql,"dsn=CBC_ORDER_I;uid=<userid>;pwd=<passwd>", 1,1 if not(ifx_punit.eof) then punit_no=ifx_punit("put_no") end if set ifx_punit = Nothing sql="UPDATE punit_filter SET punit_filter.puf_put_no = " & punit_no & " WHERE punit_filter.puf_prd_id = '" & product_no & "'" set ifx_punit_f = Server.CreateObject("ADODB.RecordSet") ifx_punit_f.Open sql,"dsn=CBC_ORDER_I;uid=<userid>;pwd=<passwd>", 3,3 set ifx_punit_f = Nothing Response.Redirect("/OK.htm") 'finish update the informix database however, I always (not all the time, the program usually work well when i restart sever and after 3 - 5 times update, this error occurs)got the following error on the browser: Microsoft OLE DB Provider for ODBC Drivers error '80004005' Login Failed /admin/update_book.asp, line 233 where line 233 is: ifx_product.Open sql,"dsn=OUR_ORDER;uid=<userid>;pwd=<passwd>", 3,3 (I omit the user name and password here) but when I close the browser and try to run a test program (test.asp it place in same directory as update-book.asp and has same file attribute, permission) <% product_no="000-0000010" sql="select * from product where prd_prd_id = '" & product_no & "'" response.write(sql) set RS_CPOHEADER = Server.CreateObject("ADODB.RecordSet") RS_CPOHEADER.Open sql,"DSN=OUR_ORDER;UID=<userid>;PWD=<passwd>", 3,3 if not(RS_CPOHEADER.eof) then response.write(RS_CPOHEADER("prd_prd_id")) RS_CPOHEADER.close end if set RS_CPOHEADER = Nothing %> I got no problem!!!! However, if I not close the browser and try to run the test program immediately, I got the same error !!! The browser 'remember' the state ? I am sure the password and username are correct and the ODBC connection is o.k (I run MS Access on the NT server nad use ODBC to connect ot Informix database without any problem) Apart from sending SQL to Informix, i try the following as well: sql="select * from product where prd_prd_id = '" & product_no & "'" set ifx_product = Server.CreateObject("ADODB.RecordSet") ifx_product.Open sql,"dsn=CBC_ORDER_I;uid=<userid>;pwd=<passwd>", 3,3 ifx_product("prd_prd_id")=product_no ifx_product("prd_desc") = product_title ifx_product("prd_author") = product_author ifx_product("prd_publisher") = product_publisher ifx_product.update ifx_product.close end if set ifx_product = Nothing and still got same result Even worse, some time I get the following error when I try to update the vendor no on the vendor table: (error message return from web server) Microsoft OLE DB Provider for ODBC Drivers error '80004005' [INTERSOLV][ODBC Informix driver][Informix]Could not do a physical-order read to fetch next row. /buy/update_book.asp, line 246 and I already create index for the vendor_filter table: (log from DBAccess) INFO - vendor_filter:'@'@ Columns'@ Indexes'@ Privileges'@ References'@ Status'@ ... Display information about indexes for the columns in a table. ----------------------- cbcdb@ifmx_tcpip ------- Press CTRL-W for Help -------- Index name'@'@'@'@'@'@'@'@ Owner'@'@'@ Type/Clstr Access Method'@'@'@'@ '@'@ Columns '@205_1098'@'@'@'@'@'@'@'@'@ informix unique/No'@ btree'@'@'@'@'@'@'@'@ '@'@'@'@'@'@ vdf_vdr_no '@vdf_prd_id vendor_filter_pid'@ informix dupls/No'@'@ btree'@'@'@'@'@'@'@'@'@'@'@'@ '@'@ vdf_prd_id and the error message when I try get the status of the vendor_filter table: (capture from DBAccess) INFO - vendor_filter:'@'@ Columns'@ Indexes'@ Privileges'@ References'@ Status'@ ... Display status information for a table. ----------------------- cbcdb@ifmx_tcpip ------- Press CTRL-W for Help -------- '@'@ 244: Could not do a physical-order read to fetch next row. '@'@ 107: ISAM error:'@ record is locked. '@ Please help. I even don't know where the problem(s) are.. please tell me how to track it down!!! Thanks a lot. Regds LAM Chi-fung