![]() ![]() ![]() ![]() |
|||||
|
|||||
樓主 Richard ![]()
![]() |
按一下 [ 重新整理] 按鈕,或稍後再試。 開啟 localhost 首頁,然後查看您想尋找之資訊的連結。 HTTP 500.100 - 內部伺服器錯誤 - ASP 錯誤 Internet Information Services -------------------------------------------------------------------------------- 技術資訊 (供技術支援人員使用) 錯誤類型: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] 運作必須使用更新查詢。 /partscenter/order.asp, line 57 瀏覽器類型: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461) 頁數: POST 156 bytes to /partscenter/order.asp POST Data: cmdShow=Yes&no_of_rec=-1&sys_sn=A000000050&Q_A000000050=1&sys_sn=A000000052&Q_A000000052=1&sys_sn=A000000062&Q_A000000062=1&sys_sn=A000000145&Q_A000000145=1 時間: 2002年3月25日, 下午 09:51:45 其他資訊: Microsoft Support ASP程式碼如下: <%@ LANGUAGE="VBSCRIPT" %> <!--#include file="ADOVBS.INC"--> <% SET ECDBproduct = SERVER.CREATEOBJECT("ADODB.Connection") ECDBproductPath = SERVER.MAPPATH("ecdb/product.mdb") ECDBproduct.OPEN "driver={Microsoft Access Driver (*.mdb)};dbq=" & ECDBproductPath SET ECDBorder = SERVER.CREATEOBJECT("ADODB.Connection") ECDBorderPath = SERVER.MAPPATH("ecdb/order.mdb") ECDBorder.OPEN "driver={Microsoft Access Driver (*.mdb)};dbq=" & ECDBorderPath sys_sn = Request.Form("sys_sn") Products = Split(sys_sn, ",") SQLstr_sn ="select * from order_list order by id desc" set RS_order=ECDBorder.Execute(SQLstr_sn) if RS_order.EOF then no = 1 else no = RS_order("id")+1 end if if len(no)=1 then order_sn = "A" +"00000"+cStr(no) if len(no)=2 then order_sn = "A" +"0000"+cStr(no) if len(no)=3 then order_sn = "A" +"000"+cStr(no) if len(no)=4 then order_sn = "A" +"00"+cStr(no) if len(no)=5 then order_sn = "A" +"0"+cStr(no) if len(no)=6 then order_sn = "A" +cStr(no) For I=0 To UBound(Products) ProductList=Products(I) If Len(ProductList) = 0 Then Response.Redirect "no_order.asp" Response.end End if Q_Productlist = Request.Form ("Q_" & ProductList) SQLstr_product = "Select * From product where sys_sn ='"& ProductList & "'" Set RS_product = ECDBproduct.Execute(SQLstr_product) SQLstr = "INSERT INTO order_list (order_sn,sys_sn,vendor,qty,price,order_date)" SQLstr = SQLstr & " VALUES ('" & order_sn & "','"& ProductList &"','"& RS_product("vendor") &"',"& Q_ProductList &","& RS_product("price") &",'" &date& "')" 'response.write sqlstr 'response.end ECDBorder.Execute(SQLstr) Next If Err.Number <> 0 Then Response.Write "錯誤號碼:"& Err.Number & "<br>" Response.Write "錯誤程式:"& Err.Source & "<br>" Response.Write "錯誤號碼:"& Err.Description & "<br>" Else Response.Write "<Br><Br><Br><Br>" Response.Write "<center><font size='3' COLOR='#0000FF'>產品購買完成<br><br>" Response.Write "<a href='index.asp'>回首頁</a></font><br><br>" Response.Write "</center>" Response.Write "<hr>" End If ECDBproduct.CLOSE ECDBorder.CLOSE %> 問題出在===>ECDBorder.Execute(SQLstr) 這行
本篇文章發表於2002-03-25 22:03
|
1樓 |
ECDBorder.Execute(SQLstr)
這個語法不對啊! 因為你並沒有設定一個變數去接收 ECODBorder 這個Connection 啊... 你應該如同上幾行的 Set RS_product = ECDBproduct.Execute(SQLstr_product) 一樣去連結 ECDBorder 的Connection 例如設定一個變數叫 RS_ECDBorder 然後去執行 ECDBorder 的Connection ,然後把SQL語法帶入 SQLstr = "INSERT INTO order_list (order_sn,sys_sn,vendor,qty,price,order_date)" SQLstr = SQLstr & " VALUES ('" & order_sn & "','"& ProductList &"','"& RS_product("vendor") &"',"& Q_ProductList &","& RS_product("price") &",'" &date& "')" 例句 Set RS_ECDBorder = ECDBorder.Execute(SQLstr) 然後使用 RS_ECDBorder 變數去讀取資料庫的內容判斷有無錯誤或是空的select
本篇文章回覆於2002-03-25 22:15
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
2樓
作者回應
Richard ![]() |
可是我已在最前面SETTING
因為我不需再抓出資料處理,所以沒設SET 最後動作只要EXECUTE應該就可以.... 還是有其他寫法會比較恰當
本篇文章回覆於2002-03-25 22:19
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
回覆 |
如要回應,請先登入. |