Hi,
I'm looking to convert some VB6 Code to .Net but can't seem
to find a solution.
either somthing like "adSchemaStatistics" is not avalible in .Net or
I can't find it.
here the VB6 Code, and perhaps sombody can clarify what the .Net version of this is.
this will return a Recordcount of each Table with DateCreated/Modified
Code:
Private Sub Command2_Click()
Dim RsL As ADODB.Recordset
Dim RsT As ADODB.Recordset
Dim Msg As String
Dim TblName As String
Dim i As Long
If cn.State = adStateClosed Then
Msg = "zuerst Connection herstellen "
MsgBox Msg, vbCritical, "Statistik Records"
Exit Sub
End If
Set RsL = New ADODB.Recordset
Set RsL = cn.OpenSchema(adSchemaStatistics)
Set RsT = New ADODB.Recordset
Set RsT = cn.OpenSchema(adSchemaTables)
With FlexInfo
.Redraw = False
.Rows = 1
.Cols = 4
.FixedCols = 0
.ColAlignment(0) = flexAlignLeftCenter
.ColAlignment(1) = flexAlignRightCenter
.TextMatrix(0, 0) = "Table"
.TextMatrix(0, 1) = "Records"
.TextMatrix(0, 2) = "Modified"
.TextMatrix(0, 3) = "Created"
.ColWidth(0) = 1800
.ColWidth(1) = 840
.ColWidth(2) = 1590
.ColWidth(3) = 1590
.AllowUserResizing = flexResizeColumns
.FocusRect = flexFocusNone
Do While Not RsL.EOF
.AddItem ""
i = .Rows - 1
TblName = RsL.Fields("Table_Name").Value
.TextMatrix(i, 0) = TblName
.TextMatrix(i, 1) = Format(RsL.Fields("Cardinality").Value, "#,###") 'Recordcount
RsT.Find "Table_Name = '" & TblName & "'"
If Not RsT.EOF Then
.TextMatrix(i, 2) = Format(RsT.Fields("Date_Modified").Value, "dd.mm.yyyy hh:mm:ss")
.TextMatrix(i, 3) = Format(RsT.Fields("Date_Created").Value, "dd.mm.yyyy hh:mm:ss")
End If
RsL.MoveNext
Loop
.Redraw = True
End With
RsL.Close
RsT.Close
Set RsL = Nothing
Set RsT = Nothing
End Sub
regards
Chris