9037.html

来自「以电子书的形式收集了VB一些常见问题解决方法,可以很方便的查找自己需要解决的问题」· HTML 代码 · 共 23 行

HTML
23
字号
<html>
  <head>
    <title>Re: 如何使用DBGrid 在非连接摸式(unband) 下写入资料</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>Re: 如何使用DBGrid 在非连接摸式(unband) 下写入资料</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by tt on January 11, 1999 at 12:03:05:<p>
In Reply to: <a href="9011.html">如何使用DBGrid 在非连接摸式(unband) 下写入资料</a> posted by TimLiu on January 09, 1999 at 18:13:10:<p>
This example illustrates the use of the UnboundAddData event to add a row of data to a database, in this case, a simple array.<p>Private Sub DBGrid1_UnboundAddData(ByVal RowBuf As RowBuffer, NewRowBookmark As Variant)<br>Dim Col%<p>mTotalRows = mTotalRows + 1<br>ReDim Preserve UserData(MAXCOLS - 1, mTotalRows - 1)<br>'Sets the bookmark to the last row.<br>NewRowBookmark = mTotalRows - 1 <p>' The following loop adds a new record to the database.<br>For Col% = 0 To UBound(UserData, 1)<br>    If Not IsNull(RowBuf.Value(0, Col%)) Then<br>        UserData(Col%, mTotalRows - 1) = RowBuf.Value(0, Col%)<p>    Else<br>        ' If no value set for column, then use the <br>        ' DefaultValue<br>        UserData(Col%, mTotalRows - 1) = DBGrid1.Columns(Col%).DefaultValue<br>    End If<br>Next Col%<br>End Sub<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 9037-->
</ul><!--end: 9037-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?