查看: 748|回复: 5
|
HHEEEELP!!不能完全Save進Microsof Access
[复制链接]
|
|
目前我面對到這樣的問題但我不知如何去解決。求各位高手版幫幫忙啦
<%
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
qty=cint(request.form("qty1"))
qty2=Cint(request.form("qty2"))
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")
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
[ 本帖最后由 jiachien 于 16-8-2006 04:22 PM 编辑 ] |
|
|
|
|
|
|
|
发表于 16-8-2006 04:17 PM
|
显示全部楼层
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&"')"
你得insert语法里面是使用 qty1
但是你没给 qty1 value.
你只给qty和qty2
qty=cint(request.form("qty1"))
qty=SafeSQL(qty)
qty2=Cint(request.form("qty2")) |
|
|
|
|
|
|
|
楼主 |
发表于 16-8-2006 05:07 PM
|
显示全部楼层
thanks your reply
原帖由 bins_188 于 16-8-2006 04:17 PM 发表
sql1 = "insert into ProductPromotion(CustomerID,ProductName,Grammage,Price,Brand,Quantity,TransactionDate,PromotionTotalPrice,Chequeno,CollectionDate) values ('"&cusid&"', '& ...
i'm actually oeldi assign the value to that variable
but inside the database all can store the value but can get the field of the quantity.. no matter what i put the datatype is it either show in blank or zero value.
aprreciate your help, 10s |
|
|
|
|
|
|
|
发表于 16-8-2006 05:25 PM
|
显示全部楼层
原帖由 jiachien 于 16-8-2006 05:07 PM 发表
i'm actually oeldi assign the value to that variable
but inside the database all can store the value but can get the field of the quantity.. no matter what i put the datatype is it either sh ...
我在你的coding里面没看到你assign value给qty1 |
|
|
|
|
|
|
|
楼主 |
发表于 16-8-2006 05:43 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 16-8-2006 11:55 PM
|
显示全部楼层
那你就用response.write看看,
看你的qty1有没有value的。
如果没有的话,
那一定是你没有给他一个value。
而且就如2楼所说的。
但是你没给 qty1 value. |
|
|
|
|
|
|
| |
本周最热论坛帖子
|