-- 作者:today_ok
-- 发布时间:2012/5/22 14:19:00
-- ACCESS数据变化后不能在窗口即时反应
此主题相关图片如下:2012-05-22_141533.jpg
各位大侠,我的数据源是ACCESS,设计了一个窗口,第一次能加载数据,但窗口运行状态我更改了数据库的内容,在窗口运行状态点再次取数也不能取最新的数据,是怎么回事?
\'第一步动态建立表一数据源 Dim a As new SQLCommand a.ConnectionName=("taobao") a.CommandText="select TradeId,TradeNo as 订单号 ,BuyerIdent as 淘宝ID, BuyerRemark as 订单备注,ReceiverState as 省份,ReceiverCity as 城市,ReceiverDistrict as 镇区,ReceiverAddress as 地址,ReceiverMobile as 手机,ReceiverPhone as 电话,ReceiverName as 联系人,ReceiverZip as 邮编, StateDesc as 订单状态,IIF(TransportType=\'free\',\'包邮\' ,\'不包邮\') as 邮费类型,GoodsAmount as 商品总数量,DiscountFee as 折扣优惠,PostFee as 邮费,TotalCash as 现金实付总金额,GoodsMoney as 商品总金额 ,\'\' as 是否存在 from {trade} where StateDesc like \'%买家已付款%\' union all select TradeId,TradeNo as 订单号 ,BuyerIdent as 淘宝ID, BuyerRemark as 订单备注,ReceiverState as 省份,ReceiverCity as 城市,ReceiverDistrict as 镇区,ReceiverAddress as 地址,ReceiverMobile as 手机,ReceiverPhone as 电话,ReceiverName as 联系人,ReceiverZip as 邮编, StateDesc as 订单状态,IIF(TransportType=\'free\',\'包邮\' ,\'不包邮\') as 邮费类型,GoodsAmount as 商品总数量,DiscountFee as 优惠金额,PostFee as 邮费,TotalCash as 总金额,GoodsMoney as 商品金额 ,\'\' as 是否存在 from TradeHistory where StateDesc like \'%买家已付款%\' order by tradeid" Dim b As DataTable b=a.ExecuteReader() Tables("网购接口_Table1").DataSource =b
这是我取数的语句,不知这样哪里不对了?
|