×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

Database contents can not display at same time

本文发表在 rolia.net 枫下论坛I have a problem with MS SQL 7.0

Table: orderinfor including
ordernumber (varchar)
username (varchar)
address (varchar)
ordertime (datatime)
cancelstatus (bit)

the database no index.

--------------------------------------------------------
ordernumber = request.form("ordernumber ")

set conn = server.createobject ("adodb.connection")
conn.open connstr

Set order=conn.execute("Select * from OrderInfor where OrderNumber='"& ordernumber &"'")

response.write "order time:" & order("ordertime") & "<br>"
response.write "cancel status:" & order("cancelstatus") & "<br>"

close.order
set conn=nothing
------------------------------------------------

in this case, the result only show the order time,

order time: 04/17/2002
cancel status:

--------------------------------------------------

if i change order
--------------------------------------------------------
ordernumber = request.form("ordernumber ")

set conn = server.createobject ("adodb.connection")
conn.open connstr

Set order=conn.execute("Select * from OrderInfor where OrderNumber='"& ordernumber &"'")


response.write "cancel status:" & order("cancelstatus") & "<br>"
response.write "order time:" & order("ordertime") & "<br>"

close.order
set conn=nothing
------------------------------------------------

the result only show the cancel status,

cancel status: true
order time:


-------------------------------------------------
the ordertime and cancelstatus can not be display
at same time.

why could this happen?

help !!!!!

thank you !!!更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / IT杂谈 / Database contents can not display at same time
    本文发表在 rolia.net 枫下论坛I have a problem with MS SQL 7.0

    Table: orderinfor including
    ordernumber (varchar)
    username (varchar)
    address (varchar)
    ordertime (datatime)
    cancelstatus (bit)

    the database no index.

    --------------------------------------------------------
    ordernumber = request.form("ordernumber ")

    set conn = server.createobject ("adodb.connection")
    conn.open connstr

    Set order=conn.execute("Select * from OrderInfor where OrderNumber='"& ordernumber &"'")

    response.write "order time:" & order("ordertime") & "<br>"
    response.write "cancel status:" & order("cancelstatus") & "<br>"

    close.order
    set conn=nothing
    ------------------------------------------------

    in this case, the result only show the order time,

    order time: 04/17/2002
    cancel status:

    --------------------------------------------------

    if i change order
    --------------------------------------------------------
    ordernumber = request.form("ordernumber ")

    set conn = server.createobject ("adodb.connection")
    conn.open connstr

    Set order=conn.execute("Select * from OrderInfor where OrderNumber='"& ordernumber &"'")


    response.write "cancel status:" & order("cancelstatus") & "<br>"
    response.write "order time:" & order("ordertime") & "<br>"

    close.order
    set conn=nothing
    ------------------------------------------------

    the result only show the cancel status,

    cancel status: true
    order time:


    -------------------------------------------------
    the ordertime and cancelstatus can not be display
    at same time.

    why could this happen?

    help !!!!!

    thank you !!!更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • debug一下每个参数的值
      • "cancelstatus" set default is (0) , other no special set up. only length.
        • 把"response.write "cancel status:" & order("cancelstatus") & "<br>" "改成===>response.write "cancel status:" & order("cancelstatus") & order("ordertime") 再试试看? 这些都需要不断的试才知道的