Problemas al agregar consulta al recordset VB 6.0 Buenos dias a todos y de antemano gracias.
Tengo la siguiente situacion:
Definicion de variables:
Dim rsk As New ADODB.Recordset
Dim sqlk as String
Base de datos: mysql
consulta:
sqlk = "select refere,detalle," _
& " IF (t1=0,'',t1) as t1,ta1 as ta1," _
& " IF (t2=0,'',t2) as t2,ta2," _
& " IF (t3=0,'',t3) as t3,ta3," _
& " IF (t4=0,'',t4) as t4,ta4," _
& " IF (t5=0,'',t5) as t5,ta5," _
& " IF (t6=0,'',t6) as t6,ta6," _
& " IF (t7=0,'',t7) as t7,ta7," _
& " IF (t8=0,'',t8) as t8,ta8," _
& " IF (t9=0,'',t9) as t9,ta9," _
& " IF (t10=0,'',t10) as t10,ta10," _
& " IF (t11=0,'',T11) AS T11,ta11," _
& " IF (cantidg1=0,'',cantidg1) as cantidg1,IF (cantidg2=0,'',cantidg2) AS cantidg2,IF (cantidg3=0,'',cantidg3) AS cantidg3," _
& "preci,preci2,preci3,total,total2,total3 from kardeximp group by refere"
rsk.Open sqlk, bdmaya, adOpenDynamic, adLockOptimistic
If rs.RecordCount <> 0 Then
Set dtafactura.DataSource = rsk
end if
Me pasa que cuando el valor de la consulta de un campo que utilizo el "if" es de dos digitos me muestra caracteres extraños en vb en datareport, o en un grid, pero si miro desde el administrador phpmyadmin, los datos estan bien. Quisiera saber si alguien sabe que ocurre. cual es solucion. |