| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 348 人关注过本帖
标题:【求助】读取数据问题
只看楼主 加入收藏
chiwei2013
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-10-3
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
【求助】读取数据问题
程序代码:
Private Sub btnSaveToDb_Click()
Dim i As Integer
Dim ii As Integer
Dim j As Integer
On Error GoTo myErr
Con.BeginTrans
j = grdRunData.Rows
grdRunData.TextMatrix(1, 3) = DTPicker1.Value
grdRunData.TextMatrix(1, 4) = DateAdd("s", 900, DTPicker1.Value)
For i = 2 To j - 1
    grdRunData.TextMatrix(i, 3) = DateAdd("s", 5, grdRunData.TextMatrix(i - 1, 3))
    grdRunData.TextMatrix(i, 4) = DateAdd("s", 5, grdRunData.TextMatrix(i - 1, 4))
Next i

With grdRunData
    i = 1
    Dim sql As String
    sql = "delete from recordTable where recordnum='" & txtRecordNum.Text & "'"
    Con.Execute (sql)
    For i = 1 To .Rows - 1
      sql = "INSERT INTO recordTable " & _
        "(recordtime,recordnum,recordpeple,method,projname,concentration,analyseid,addbactime,recordbactime,lightvolume,relativevolume,mean,inhibition,notes,idnum) " & _
        " VALUES (" & _
        "'" & lblRecDT.Caption & "', " & _
        "'" & txtRecordNum.Text & "', " & _
        "'" & txtRecordPeople.Text & "', " & _
        "'" & txtRecordMethod.Text & "', " & _
        "'" & Text1.Text & "', " & _
        "'" & .TextMatrix(i, 1) & "', " & _
        "'" & .TextMatrix(i, 2) & "', " & _
        "'" & .TextMatrix(i, 3) & "', " & _
        "'" & .TextMatrix(i, 4) & "', " & _
        "'" & .TextMatrix(i, 5) & "', " & _
        "'" & .TextMatrix(i, 6) & "', " & _
        "'" & .TextMatrix(i, 7) & "', " & _
        "'" & .TextMatrix(i, 8) & "', " & _
        "'" & .TextMatrix(i, 9) & "', " & _
        "'" & .TextMatrix(i, 0) & _
        "')"

为什么第三列和第四列没有时间显示,
2013-10-03 15:40
Artless
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:103
帖 子:4211
专家分:28888
注 册:2009-4-8
收藏
得分:20 
Con.BeginTrans是什么?

无知
2013-10-04 12:04
快速回复:【求助】读取数据问题
数据加载中...
 
   



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

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