| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 347 人关注过本帖
标题:請教一下問題
只看楼主 加入收藏
jxyga111
Rank: 8Rank: 8
来 自:中華人民共和國
等 级:贵宾
威 望:33
帖 子:6015
专家分:895
注 册:2008-3-21
结帖率:70%
收藏
 问题点数:0 回复次数:1 
請教一下問題
Set mObjrs = Nothing
  mObjrs.Open "
select T01,T02,T03,kfname1,yjprice1,maxamt1,kfname,
yjprice2,maxamt2,cb,remark,auditing from t_yjmax where T01='" & Text11.Text & "' AND T02='" & Text10.Text & "'", Gobjcn, adOpenKeyset, adLockOptimistic

 name = mObjrs("auditing")   --這里錯了因為沒有資料


               If IsNull(mObjrs.Fields("auditing")) <> Empty Or mObjrs.Fields("auditing") <> Null Or mObjrs.Fields("auditing") <> "" Then
                        Set mObjrs = Nothing
                        mObjrs.CursorLocation = adUseClient
                        mObjrs.Open "select T01,T02,T03,kfname1,yjprice1,maxamt1,kfname,yjprice2,maxamt2,cb,remark   from t_yjmax where  LEFT(T02,8) between '" & Format(DTP1.Value, "yyyymmdd") & "' AND '" & Format(DTP2.Value, "yyyymmdd") & "' AND T01='" & Text11.Text & "' AND T02='" & Text10.Text & "'", Gobjcn,   adOpenKeyset, adLockOptimistic
 Else
        Gobjcn.Execute "delete from t_yjmax where T02='" & Text10.Text & "' and T01='" & Text11.Text & "' and LEFT(T02,8) BETWEEN '" & Format(DTP1.Value, "yyyymmdd") & "' AND '" & Format(DTP2.Value, "yyyymmdd") & "'"
                    strquery = "insert into t_yjmax select stime1='" & Strime1 & "',T01,T02,T03,kfname1='joe',yjprice1=0,maxamt1=0,TC008,kfname='mark',yjprice2=0,maxamt2=0,cb=0,remark='',auditing='',auddate=" & Frmauditing.DTPicker1.Value & " from t_ta  LEFT JOIN t_tb  ON T01=Tb01 AND T02=Tb02 where T02='" & Text10.Text & "' AND T01='" & Text11.Text & "' AND LEFT (T02,8) BETWEEN '" & Format(DTP1.Value, "YYYYMMDD") & "' AND '" & Format(DTP2.Value, "YYYYMMDD") & "' "
                    Gobjcn.Execute strquery

                    Set mObjrs = Nothing
                    mObjrs.CursorLocation = adUseClient
                    mObjrs.Open "select T01,T02,T03,kfname1,yjprice1,maxamt1,kfname,yjprice2,maxamt2,cb,remark from t_yjmax where  LEFT(T02,8) between '" & Format(DTP1.Value, "yyyymmdd") & "' AND '" & Format(DTP2.Value, "yyyymmdd") & "' AND T01='" & Text11.Text & "' AND T02='" & Text10.Text & "' and auditing='" & "'", Gobjcn, adOpenKeyset, adLockOptimistic
  End If 大家幫一忙我這個是要從另外兩個表插到一個表,但是又有審核還不能重復
如果打這張表里沒有的就出錯,因為還沒有插入這張表,還不能把審核給刪了,
幫下忙
搜索更多相关主题的帖子: 有點難 
2008-05-29 20:08
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
很好奇……都Nothing了还怎么Open?
2008-05-29 20:35
快速回复:請教一下問題
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018984 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved