佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 696|回复: 2

HHEEEELP!!不能完全Save進Microsof Access

[复制链接]
发表于 16-8-2006 03:59 PM | 显示全部楼层 |阅读模式
目前我面對到這樣的問題但我不知如何去解決。求各位高手版幫幫忙啦

我的問題是那些號碼不能save 進database。
我的Coding如以下:

<%
dim qty1,qty2,total1,total2,total,chequeno,subop,collectdate,num
dim proname,gram1,gram2,size1,size2,brand1,brand2,dat,sql1,sql2
response.buffer=true

session.lcid=1033


total1=(qty* cint("10"))
total2=(qty2* cint("20"))
total= (total1 + total2)

dat=session("dat")

cusid=session("cusid")

proname=("WoodFree")
gram1=("70G")
gram2=("80G")
size1=("31x43")
size2=("25x35.5")
brand1=("SFI(Sabah)")
brand2=("IK(Indonesia)")
price1=cint("10")
price2=cint("20")
num=cint("0")


Function SafeSQL( _
   ByVal strToRenderSafe _
   )

   SafeSQL = Replace(strToRenderSafe, "'", "''")

End Function

qty=cint(request.form("qty1"))
qty=SafeSQL(qty)
qty2=Cint(request.form("qty2"))

        if request.form("cheque")="" then
                chequeno = cint("0")
        else
                chequeno=cint(request.form("cheque"))
        end if




if request.querystring("add")= "true" then
        'collectdate=request.form("dateNo")
       

set conn = server.createobject("ADODB.Connection")
conn.open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = "& Server.mappath("data/ON9.mdb") &";"

sql1 = "insert into ProductPromotion(CustomerID,ProductName,Grammage,Price,Brand,Quantity,TransactionDate,PromotionTotalPrice,Chequeno,CollectionDate) values ('"&cusid&"', '"&proname&"','"&gram1&"','"&price1&"','"&brand1&"',"&qty1&",'"&dat&"','"&chequeno&"','"&comfirmDate&"','"&collectdate&"')"

set RS = conn.Execute(sql1)
end if        

%>


我查了好多次多不知道爲什麽那些quantity不能save in ms Access but it save the value in the field with default such as zero
回复

使用道具 举报


ADVERTISEMENT

发表于 18-8-2006 01:30 AM | 显示全部楼层
建议你先把那个SQL写出来,看QTY1有没有VALUE。可能是之前CODING算错呢
RESPONSE.WRITE SQL1
response.end
加在 set RS = .....上面
如果没有value的话就要check coding哪里算错了
回复

使用道具 举报

发表于 18-8-2006 01:47 AM | 显示全部楼层
在你的 sql 里, 你的 quantity 是 qty1, 但在你的 code 里... 却没有 assign qty1?

应该是这 code 当中其中之一出错了:


qty=cint(request.form("qty1"))
qty=SafeSQL(qty)
qty2=Cint(request.form("qty2"))
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 23-9-2024 11:28 AM , Processed in 0.113789 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表