10 个解决方案
#1
你指的移动是指光标移动还是光标不动 数据行移动?
#2
dataControl1.DataSource.MoveNext
#3
dataControl1.DataSource.MOVEFIRST
dataControl1.DataSource.MovePrevious
dataControl1.DataSource.MoveNext
dataControl1.DataSource.MOVELAST
dataControl1.DataSource.MovePrevious
dataControl1.DataSource.MoveNext
dataControl1.DataSource.MOVELAST
#4
说dataControl1未声明????????
#5
可以借用adodc控件
#6
adodc是什么?怎么用?
#7
Private m_rs As ADODB.Recordset
Private m_cn As ADODB.Connection
Private m_Cmd As ADODB.Command
Private Sub Command1_Click()
On Error GoTo errhandle
'SELECT * FROM TestParam
m_Cmd.CommandText = Text1.Text
Set m_rs = m_Cmd.Execute()
Set DataGrid1.DataSource = m_rs
DataGrid1.ClearFields
DataGrid1.ReBind
DataGrid1.Refresh
Exit Sub
errhandle:
MsgBox Err.Description & Err.Number
End Sub
Private Sub Form_Load()
Set m_rs = New ADODB.Recordset
Set m_cn = New ADODB.Connection
Set m_Cmd = New ADODB.Command
m_cn.ConnectionString = Adodc1.ConnectionString
m_cn.CursorLocation = adUseClient
m_cn.Open
Set m_Cmd.ActiveConnection = m_cn
End Sub
Private Sub Form_Resize()
DataGrid1.Move 0, 0, Me.Width, Me.Height
End Sub
#8
移动记录3楼正解
#9
但是他说dataControl1未声明????????
#10
那你先要抓一个adodc放入窗体,命名为dataControl1
#1
你指的移动是指光标移动还是光标不动 数据行移动?
#2
dataControl1.DataSource.MoveNext
#3
dataControl1.DataSource.MOVEFIRST
dataControl1.DataSource.MovePrevious
dataControl1.DataSource.MoveNext
dataControl1.DataSource.MOVELAST
dataControl1.DataSource.MovePrevious
dataControl1.DataSource.MoveNext
dataControl1.DataSource.MOVELAST
#4
说dataControl1未声明????????
#5
可以借用adodc控件
#6
adodc是什么?怎么用?
#7
Private m_rs As ADODB.Recordset
Private m_cn As ADODB.Connection
Private m_Cmd As ADODB.Command
Private Sub Command1_Click()
On Error GoTo errhandle
'SELECT * FROM TestParam
m_Cmd.CommandText = Text1.Text
Set m_rs = m_Cmd.Execute()
Set DataGrid1.DataSource = m_rs
DataGrid1.ClearFields
DataGrid1.ReBind
DataGrid1.Refresh
Exit Sub
errhandle:
MsgBox Err.Description & Err.Number
End Sub
Private Sub Form_Load()
Set m_rs = New ADODB.Recordset
Set m_cn = New ADODB.Connection
Set m_Cmd = New ADODB.Command
m_cn.ConnectionString = Adodc1.ConnectionString
m_cn.CursorLocation = adUseClient
m_cn.Open
Set m_Cmd.ActiveConnection = m_cn
End Sub
Private Sub Form_Resize()
DataGrid1.Move 0, 0, Me.Width, Me.Height
End Sub
#8
移动记录3楼正解
#9
但是他说dataControl1未声明????????
#10
那你先要抓一个adodc放入窗体,命名为dataControl1