0
每当我单击此命令时出现错误。我试图把交易历史记录放在交易号和收益的字段中,其他字段仅用于库存。VB6.0将记录添加到数据库(列表视图)
Private Sub Command1_Click()
Dim earnings As Double
earnings = txtCash - txtChange
ConnectDB
rs.Open "Select TransactionNo, Earnings from Table2", db, 3, 3
rs.AddNew
rs(0) = txtNumber 'rs(1) is an auto number
rs(2) = txtProduct 'Here i got an error, it says Item cannot be found in the 'collection corresponding to the requested name or ordinal
rs(3) = txtStockLeft
rs(4) = txtPricePiece
rs(5) = txtExpiry
rs(6) = earnings
rs.Update
Set rs = Nothing
db.Close: Set rs = Nothing
LoadData1
ListView2.ListItems.Clear
LoadData
这里有什么问题?
它帮助我选择所有列 ConnectDB rs.Open“表2”,DB,3,3 我只隐藏使用0宽度 随着ListView2.ColumnHeaders 。新增,“ID”其他数据,10 .Add,,“Number”,1000 .Add,,“ProductName”,0 .Add,,“Stock”,0 .Add,,“PricePiece”,0 .Add,,“Expiry” ,0 。添加,,“收入”,1200 – Francis
多数民众赞成在我能够帮助你。 – DevelopmentIsMyPassion