日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

VB6 XArrayDB | Xarray ReDim 用法

發布時間:2025/7/14 编程问答 16 豆豆
生活随笔 收集整理的這篇文章主要介紹了 VB6 XArrayDB | Xarray ReDim 用法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

用法解釋

官方解釋:http://helpcentral.componentone.com/nethelp/truedblist8/default.htm#!redimmethodxarraydb.htm

XArrayDB Reference / XArrayDB Object Methods
ReDim Method (XArrayDB)

This method is used to set or reset the dimensions of an XArrayDB object while preserving any existing data.
Syntax
XArrayDB.ReDimrowLB, rowUB, columnLB, columnUB(解釋)
Arguments
rowLB and rowUB are long integers specifying the lower and upper bounds for row indexes.
columnLB and columnUB are long integers specifying the lower and upper bounds for column indexes.
Return Value
None
Remarks
Method applies to XArrayDB object.
Since a newly created XArrayDB object does not have any default dimensions, you must use the ReDim method before you can assign or access array elements.
Example
The following example creates and initializes a two-dimensional XArrayDB object. The first dimension has 100 elements, with indexes starting at 1 and ending at 100. The second dimension has 6 elements, with indexes starting at 0 and ending at 5.
Dim MyArray As New XArrayDB
MyArray.ReDim 1, 100, 0, 5


例子綁定用 XArray綁定 TDBGrid

Dim X As New XArray
Private Sub Form_Load()
Dim r As Integer
Dim c As Integer
Dim clmn As TrueDBGrid80.Column‘列
r = 9 'row
c = 5 'column
X.ReDim 0, r, 0, c
TDBGrid1.Columns.Clear
For k = 0 To c
Set clmn = TDBGrid1.Columns.Add(k)'動態添加列
clmn.Visible = True
clmn.Caption = "column " & k
Next k
Call FillXArray(r, c)‘填充數據
Set Me.TDBGrid1.Array = X
Me.TDBGrid1.ReBind
End Sub
Private Sub FillXArray(intI As Integer, intJ As Integer)’填充數據
On Error Resume Next
Dim I As Integer
Dim j As Integer
Dim k As Integer

For I = 0 To intIFor j = 0 To intJX(I, j) = " row:" & I & ",column" & jIf Err Then Exit ForNext jIf Err Then Exit For Next I

If (Err.Number <> 0) Then
MsgBox Err.Description
End If
End Sub

轉載于:https://www.cnblogs.com/wgscd/p/5212313.html

總結

以上是生活随笔為你收集整理的VB6 XArrayDB | Xarray ReDim 用法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。