Ver Mensaje Individual
  #4 (permalink)  
Antiguo 23/04/2008, 09:38
lviera86
 
Fecha de Ingreso: abril-2008
Mensajes: 17
Antigüedad: 17 años
Puntos: 0
Re: Mostrar varios registros de una consulta en MySQL

ahhhh mi bella no ves, ahora si nos entendemos, bueno casualmente estub haciendo algo.

para llenar un MSFlexGrid con

'************************************************* *****

Public conn As New ADODB.Connection
Dim rs333 As New ADODB.Recordset


' ********** Construimos la tabla
tabla1.Clear
Fila = 1
Filas = 2
Columnas = 5
tabla1.Rows = Filas ' filas
tabla1.Cols = Columnas ' columnas
tabla1.TextMatrix(0, 0) = "Codigo"
tabla1.TextMatrix(0, 1) = "Descripcion"
tabla1.TextMatrix(0, 2) = "Cantidad"
tabla1.TextMatrix(0, 3) = "Precio_Unitario"
tabla1.TextMatrix(0, 4) = "Precio_Total"
'******************************



'**** luego hacemos la consula y el resultado lo añadrimos a la tabla:
' asumac q tabla1 nombre q se le da al MSFlexGrid


SQL = "select * from view_cantidad_presupuesto where nfactura = '" & presu & "'"
If rs333.State = 1 Then rs333.Close
rs333.Open SQL, conn, 3, 3

Fila = 1
rs333.MoveFirst
While rs333.EOF = False

tabla1.TextMatrix(Fila, 0) = rs333.Fields("codigo_producto")
tabla1.TextMatrix(Fila, 1) = rs333.Fields("descripcion")
tabla1.TextMatrix(Fila, 2) = rs333.Fields("cantidad")
tabla1.TextMatrix(Fila, 3) = rs333.Fields("precio_unitario")
tabla1.TextMatrix(Fila, 4) = rs333.Fields("precio_total")

contarsiniva = CDbl(contarsiniva) + CDbl(rs333.Fields("precio_unitario")) * Val(rs333.Fields("cantidad"))
totalsiniva.Caption = contarsiniva & " Bs.F"
totalconiva.Caption = (contarsiniva + CDbl(contarsiniva * IVA_)) & " Bs.F"

rs333.MoveNext
Fila = Fila + 1
Filas = Filas + 1
tabla1.Rows = Filas ' filas
End If
Wend

' ************************************


espero esta parte te ayude, saludos Kitty_05 y suerte