sachin
06-07-2002, 06:14 AM
Hi there,
I have a data grid and i have a record set. so how can i show entire table structure into the data grid.
the coding is this:
Set cn = New ADODB.Connection
With cn
.Provider = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False"
.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\guage.mdb;Persist Security Info=False"
End With
Dim rsplug As New ADODB.Recordset
rsplug.Open "Select * from plugguage", cn, adOpenDynamic, adLockOptimistic
With rsplug
Do While Not .EOF
Form1.DataGrid1.Columns(0) = rsplug("GoSize").Value
Form1.DataGrid1.Columns(1) = rsplug("MU").Value
Form1.DataGrid1.Columns(2) = rsplug("NoGoSize").Value
Form1.DataGrid1.Columns(3) = rsplug("LocationNo").Value
Form1.DataGrid1.Columns(4) = Format(rsplug("CalibratedDt").Value, "mm/dd/yyyy")
Form1.DataGrid1.Columns(5) = rsplug("ToBeCalibrated").Value
Form1.DataGrid1.Columns(6) = rsplug("Description").Value
Form1.DataGrid1.Columns(7) = rsplug("Qty").Value
.MoveNext
Loop
End With
at bold part it shows me "run time error "7005"....Row set not available"
please help me.
sachin
I have a data grid and i have a record set. so how can i show entire table structure into the data grid.
the coding is this:
Set cn = New ADODB.Connection
With cn
.Provider = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False"
.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\guage.mdb;Persist Security Info=False"
End With
Dim rsplug As New ADODB.Recordset
rsplug.Open "Select * from plugguage", cn, adOpenDynamic, adLockOptimistic
With rsplug
Do While Not .EOF
Form1.DataGrid1.Columns(0) = rsplug("GoSize").Value
Form1.DataGrid1.Columns(1) = rsplug("MU").Value
Form1.DataGrid1.Columns(2) = rsplug("NoGoSize").Value
Form1.DataGrid1.Columns(3) = rsplug("LocationNo").Value
Form1.DataGrid1.Columns(4) = Format(rsplug("CalibratedDt").Value, "mm/dd/yyyy")
Form1.DataGrid1.Columns(5) = rsplug("ToBeCalibrated").Value
Form1.DataGrid1.Columns(6) = rsplug("Description").Value
Form1.DataGrid1.Columns(7) = rsplug("Qty").Value
.MoveNext
Loop
End With
at bold part it shows me "run time error "7005"....Row set not available"
please help me.
sachin