Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /home/jopp289/domains/progmans.net/public_html/engine/classes/mysqli.class.php on line 162 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 VB6, Visual Basic 6
Заголовок



rcd - рекордсет (ADODB.Recordset)
UM - имя поля (колонки), значение которого нужно получить
0 - индекс поля (колонки), значение которого нужно получить
cn - соединение с базой данных (ADODB.Connection)



sq = "SELECT TOP 1 UM FROM r_Prods
rcd.Open sq, cn, adOpenStatic

MsgBox rcd!UM        ......(Вариант 1)
MsgBox rcd(0).Value        ......(Вариант 2)



fg - VSFlexGrid
3 - порядковый номер поля (колонки)

fg.ColKey(3) = "BarCode"



fg - VSFlexGrid
rcd - рекордсет (ADODB.Recordset)
cn - соединение с базой данных (ADODB.Connection)



Sub RefreshVSFlexGrid()

     fg.Redraw = flexRDNone
On Error GoTo err1

     sq = "SELECT * FROM r_Prods"
     rcd.Open sq, cn, adOpenStatic

     With fg
         Set .DataSource = rcd

         .Cell(flexcpAlignment, 0, 0, 0, .Cols - 1) = flexAlignCenterCenter
         .RowHeight(0) = 400

         For i = .FixedCols To .Cols - 1
                 .ColHidden(i) = True
         Next i

         .ColHidden(.ColIndex("ProdID")) = False
         .ColHidden(.ColIndex("ProdName")) = False

         .ColPosition(.ColIndex("ProdID")) = 1
         .ColPosition(.ColIndex("ProdName")) = 2

         .TextMatrix(0, .ColIndex("ProdID")) = "Код"
         .TextMatrix(0, .ColIndex("ProdName")) = "Товар"

         .ColWidth(.ColIndex("ProdID")) = 900
         .ColWidth(.ColIndex("ProdName")) = 2000

     End With

     fg.Redraw = flexRDDirect
     Screen.MousePointer = 0

     Exit Sub
err1:
     fg.Redraw = flexRDDirect
     Screen.MousePointer = 0
     MsgBox "Случилась ошибка!" & Chr(13) & err.Description, vbCritical, "Сообщение"

End Sub



fg - VSFlexGrid

If fg.SelectedRows > 0 Then
     For i = 0 To fg.SelectedRows - 1
         fg.RemoveItem fg.SelectedRow(0)
     Next
End If



fg - VSFlexGrid
fg.Row - текущая строка грида


MsgBox fg.TextMatrix(fg.Row, fg.ColIndex("ColName"))



назад 1 2 3 4 5 далее