23-12-15, 02:22 AM
أهلا أخي الكريم , جرب التعديل التالي :
PHP كود :
Private Sub Command1_Click()
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
If RS.State = adStateOpen Then RS.Close
RS.Open "SELECT partid FROM partsTable ", Db, adOpenStatic, adLockOptimistic
If RS.RecordCount > 0 Then
Set DataGrid1.DataSource = RS.Clone
RS.MoveFirst
Do While Not RS.EOF
Text1.Text = RS![partid]
MsgBox Text1.Text
RS.MoveNext
Loop
Else
Set DataGrid1.DataSource = Nothing
Text1.Text = ""
MsgBox "لايوجد سجلات"
End If
End Sub

