7,759
社区成员
发帖
与我相关
我的任务
分享
strSql = "select playdate,playtime,name from result where sampleid = '" & Trim(grdSample.TextMatrix(i, 9)) & "'"
Set rcdBuf1 = New ADODB.Recordset
rcdBuf1.CursorLocation = adUseClient
rcdBuf1.Open strSql, gADOConnection, , adLockReadOnly
If Not (rcdBuf1.EOF And rcdBuf1.BOF) Then
For j = 6 To rcdBuf1.RecordCount - 1
mysheet.Rows(j).Insert
mysheet.Cells(j, 5).Value = rcdBuf1("playdate")
mysheet.Cells(j, 6).Value = grdSample.TextMatrix(i, 2)
mysheet.Cells(j, 7).Value = grdSample.TextMatrix(i, 3)
mysheet.Cells(j, 8).Value = rcdBuf1("playtime")
mysheet.Cells(j, 10).Value = rcdBuf1("name")
Next j
End If
For j = 0 To rcdBuf1.RecordCount - 1
mysheet.Rows(j + 6).Insert
mysheet.Cells(j + 6, 5).Value = rcdBuf1("playdate")
mysheet.Cells(j + 6, 6).Value = grdSample.TextMatrix(i, 2)
mysheet.Cells(j + 6, 7).Value = grdSample.TextMatrix(i, 3)
mysheet.Cells(j + 6, 8).Value = rcdBuf1("playtime")
mysheet.Cells(j + 6, 10).Value = rcdBuf1("name")
If Not rcdBuf1.EOF Then
rcdBuf1.MoveNext
End If
Next j