7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub Command1_Click()
Text3.Text = sum(Int(Text2.Text), Int(Text1.Text))
Command1.Caption = Text3.Text
End Sub
Public Function sum(x As Integer, y As Integer) As String
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.Open "driver={sql server};server=xxj\XXXXXJ;database=mbk;uid=sa;pwd=1"
SQL = "select * from number"
rs.Open SQL, conn
Set MSHFlexGrid1.DataSource = rs
sum = MSHFlexGrid1.TextMatrix(x, y)
rs.Close
conn.Close
End Function
Private Sub Command1_Click()
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.Open "driver={sql server};server=xxj\XXXXXJ;database=mbk;uid=sa;pwd=1" '连接数据库
SQL = "select * from number"
rs.Open SQL, conn
Set MSHFlexGrid1.DataSource = rs
Text3.Text = MSHFlexGrid1.TextMatrix(Int(Text2.Text), Int(Text1.Text))
rs.Close
conn.Close
End Sub