On Thu, Nov 6, 2008 at 5:50 PM, Emanuel CALVO FRANCO <[EMAIL PROTECTED]> wrote: > Pasa a la lista el INSERT (no el codigo Visual) que queres ejecutar en > postgres, y te podemos decir si es correcto o no. > > Ya de entrada, me parece que hay algo que esta mal > > "INSERT INTO " & IIf(AccionGuia = 2, "guiatmp", "guia") & " (id, > fecha, codairway, NumAirWay, AirWayBill, " _
Para mi eso esta bien ...porque esta solo formando un string para pasarle a la Bd... revisa el string que le estas pasando a la BD al final y ese envialo... ahi te daras cuenta enseguida que puede estar pasando ... Slds. J > > esto es mal parseado y hay algo que no me cierra mucho que es ese iif > en el medio, dentro de una asignacion... > > pasa la consulta solamente porque sinceramente es peor que pasarle un > dtrace a un programa hecho en smalltalk. ;P > > > > > 2008/11/6 GRUPO SIC, S.A. DE C.V. <[EMAIL PROTECTED]>: >> >> >> >> >> -----Mensaje original----- >> De: GRUPO SIC, S.A. DE C.V. [mailto:[EMAIL PROTECTED] >> Enviado el: Miércoles, 05 de Noviembre de 2008 05:39 p.m. >> Para: 'pgsql-es-ayuda@postgresql.org' >> Asunto: ayuda please INSERT VISUAL B 6 POSTGRES >> >> >> >> Saludos espero me puedan ayudar o dar una idea >> >> Estoy migrando una aplicación en visual 6 con acces a v baisc 6 con >> postgresql >> >> >> >> Ya migre la base , y ya realice la conexión en algunas partes ya esta >> funcional pero en otras aun no trabaja >> >> Ya realice el cambio de los campos de la bd a minusculas >> >> >> >> Ya revise los campos de las tablas en este insert y todos los campos son >> correctos, pero el problema es que no envia ningun error >> >> Y tampoco inserta datos (ALGUNA RESTRICCION O CAMBIO DE FORMATO CON POSTGRES >> ¿?) >> >> GRACIAS POR SU AYUDA >> >> >> >> CadenaComando = "INSERT INTO " & IIf(AccionGuia = 2, "guiatmp", "guia") & " >> (id, fecha, codairway, NumAirWay, AirWayBill, " _ >> >> ' & "Dir1, Dir2, Dir3, Rfc, Pais, NumGuia, DigitoVerif, >> IdShipper, " _ >> >> ' & "Shipper, Dir1Ship, Dir2Ship, Dir3Ship, Dir4Ship, >> IdConsignee, Consignee, Dir1Consig, " _ >> >> ' & "Dir2Consig, Dir3Consig, Dir4Consig, IdCarrier, Carrier, >> Dir1Carrier, Dir2Carrier, AgIATACarrier, " _ >> >> ' & "AccountNo, AccountInf1, AccountInf2, AccountInf3, >> Airport, ToP1, " _ >> >> ' & "ByFirstCarrier, To1, By1, To2, By2, Reference, >> OptShipInf1, OptShipInf2, " _ >> >> ' & "PCurrencyy, CHGSCod, WV_ppd, WV_coll, OT_ppd, OT_coll, >> DeclareValue_Carr, " _ >> >> ' & "DeclareValue_Cust, AirportDest, FlightDate1, >> FlightDate2, Amount, " _ >> >> ' & "HandlingInf, handlinginf2, handlinginf3, SCI, " >> >> >> >> 'CadenaComando2 = "IdPartida, PNoPieces, PGross, PUm, >> PRateClass, PComodity, " _ >> >> ' & "PChargeable, PRate_Charge, PTotal, PNature, >> OCharges_Desc1, OCharges_Val1, " _ >> >> ' & "OCharges_Desc2, OCharges_Val2, OCharges_Desc3, >> OCharges_Val3, OCharges_Desc4, " _ >> >> ' & "OCharges_Val4, OCharges_Desc5, OCharges_Val5, >> OCharges_Desc6, OCharges_Val6, " _ >> >> ' & "OCharges_Desc7, OCharges_Val7, OCharges_Desc8, >> OCharges_Val8, OCharges_Desc9, OCharges_Val9, OCharges_Desc10, >> OCharges_Val10, OCharges_Desc11, OCharges_Val11, OCharges_Desc12, >> OCharges_Val12, SignatureShip, ExecutedOn, ExecutedOn2, SignatureCarr, >> TWeightC_Pre, TWeightC_Coll, " _ >> >> ' & "TValuatC_Pre, TValuatC_Coll, TTax_Pre, TTax_Coll, >> TTotOtherCAgent_Pre, " _ >> >> ' & "TTotOtherCAgent_Coll, TTotOtherCCarrier_Pre, >> TTotOtherCCarrier_Coll, " _ >> >> ' & "TTOTAL_PREPAID, TTOTAL_COLLECT, TCurrencyyConvr, >> TccCharges, TChargesDest, " _ >> >> ' & "TTotalColl_Charges, PDimentios, Fac_PesoVol, PNature2, >> PNature3, PNature4, PNature5, PNature6, PNature7, PNature8, PNature9, >> PNature10, PNature11, PNature12, PNature13, PNature14,agreed, IdMaquina)" >> >> >> >> 'CadenaSql = ValNulo(rcs(0)!nueva) + 1 & ",' #" & >> Format(FrPrin.Txt(2), "dd/mm/yy") & "#','" & Trim(Mid(FrPrin.CmbAW, InStr(1, >> FrPrin.CmbAW, " -") + 2)) & "', '" & StrNulo(Mid(FrPrin.CmbAW, 1, 3)) & "', >> '" & StrNulo(FrPrin.LblAirWay(0)) & "', '" & StrNulo(FrPrin.LblAirWay(1)) & >> "', '" & StrNulo(FrPrin.LblAirWay(2)) & "', '" & >> StrNulo(FrPrin.LblAirWay(3)) & "', '" & StrNulo(FrPrin.LblAirWay(4)) & "', >> '" & StrNulo(FrPrin.Txt(0)) & "', '" & StrNulo(FrPrin.Txt(1)) & "', " & >> ValNulo(FrPrin.LblDigito) & ", '" & StrNulo(FrPrin.TLblNS) _ >> >> ' & "', '" & StrNulo(FrPrin.CmbShip) & "', '" & >> StrNulo(Trim(Mid(FrPrin.LblDirS(0), 1, 39))) & "', '" & >> StrNulo(Trim(Mid(FrPrin.LblDirS(1), 1, 39))) & "', '" & >> StrNulo(Trim(Mid(FrPrin.LblDirS(2), 1, 39))) & "', '" & >> StrNulo(Trim(Mid(FrPrin.LblDirS(3), 1, 39))) & "', '" & >> StrNulo(FrPrin.TLblNC) & "', '" & StrNulo(FrPrin.CmbCon) & "', '" & >> StrNulo(Trim(Mid(FrPrin.TxtDirC(0), 1, 39))) & "', '" & >> StrNulo(Trim(Mid(FrPrin.TxtDirC(1), 1, 39))) & "', '" & >> StrNulo(Trim(Mid(FrPrin.TxtDirC(2), 1, 39))) & "', '" & >> StrNulo(Trim(Mid(FrPrin.TxtDirC(3), 1, 39))) & "', '" & 0 & "', '" & >> StrNulo(FrPrin.TxtCarrier) & "', '" & StrNulo(FrPrin.LblDirCarr(0)) & "', '" >> & StrNulo(FrPrin.LblDirCarr(1)) & "', '" & StrNulo(FrPrin.Txt(7)) & "', '" & >> StrNulo(FrPrin.Txt(8)) & "', '" & StrNulo(FrPrin.Txt(4)) & "', '" _ >> >> ' & StrNulo(FrPrin.Txt(5)) & "', '" & StrNulo(FrPrin.Txt(6)) >> & "', '" & StrNulo(FrPrin.Txt(9)) & "', '" & StrNulo(Mid(FrPrin.CmbAer, 1, >> 3)) & "', '" & StrNulo(FrPrin.Txt(14)) & "', '" & StrNulo(FrPrin.Txt(15)) & >> "', '" & StrNulo(FrPrin.Txt(16)) & "', '" & StrNulo(FrPrin.Txt(17)) & "', '" >> & StrNulo(FrPrin.Txt(18)) & "', '" & StrNulo(FrPrin.Txt(10)) & "', '" & >> StrNulo(FrPrin.Txt(11)) & "', '" & StrNulo(FrPrin.Txt(12)) _ >> >> ' & "', '" & StrNulo(FrPrin.Txt(19)) & "', '" & >> StrNulo(FrPrin.Txt(20)) & "', " & IIf(FrPrin.Chk(0).Value, 1, 0) & ", " & >> IIf(FrPrin.Chk(1).Value, 1, 0) & ", " & IIf(FrPrin.Chk(2).Value, 1, 0) & ", >> " & IIf(FrPrin.Chk(3).Value, 1, 0) & ", '" & StrNulo(FrPrin.Txt(21)) & "', >> '" & StrNulo(FrPrin.Txt(22)) & "', '" & StrNulo(FrPrin.Txt(23)) & "', '" & >> StrNulo(FrPrin.Txt(24)) & "', '" & StrNulo(FrPrin.Txt(25)) & "', '" _ >> >> ' & StrNulo(FrPrin.Txt(26)) & "', '" _ >> >> ' & StrNulo(FrPrin.Txt(27)) & "', '" & >> StrNulo(FrPrin.TxtHand2) & "', '" & StrNulo(FrPrin.TxtHand3) & "', '" & >> StrNulo(FrPrin.Txt(28)) & "', " & ValNulo(rcs(0)!nueva) + 1 & ", " & >> ValNulo(TxtNew(1)) & ", '" & StrNulo(TxtNew(2)) & "', '" & StrNulo(CmbUm) & >> "', '" & StrNulo(CmbRC) & "', '" & StrNulo(TxtNew(3)) & "', " & >> ValNulo(TxtNew(4)) & ", '" & StrNulo(TxtNew(5)) & "', " & ValNulo(TxtNew(6)) >> & ", '" & StrNulo(TxtNat(0)) & "', '" & StrNulo(FrPrin.CmbOC(0)) & "', " _ >> >> ' & ValNulo(FrPrin.TxtOC(3)) & ", '" & >> StrNulo(FrPrin.CmbOC(1)) & "', " & ValNulo(FrPrin.TxtOC(4)) & ", '" & >> StrNulo(FrPrin.CmbOC(2)) & "', " & ValNulo(FrPrin.TxtOC(5)) & ", '" & >> StrNulo(FrPrin.CmbOC(6)) & "', " & ValNulo(FrPrin.TxtOC(9)) & ", '" & >> StrNulo(FrPrin.CmbOC(7)) & "', " & ValNulo(FrPrin.TxtOC(10)) & ", '" & >> StrNulo(FrPrin.CmbOC(8)) & "', " & ValNulo(FrPrin.TxtOC(11)) & ", '" & >> StrNulo(FrPrin.CmbOC(3)) & "', " & ValNulo(FrPrin.TxtOCA(1)) & ", '" & >> StrNulo(FrPrin.CmbOC(9)) & "', " & ValNulo(FrPrin.TxtOCC(1)) & ", '" & >> StrNulo(FrPrin.CmbOC(4)) & "', " & ValNulo(FrPrin.TxtOCAN(0)) & ", '" & >> StrNulo(FrPrin.CmbOC(5)) & "', " & ValNulo(FrPrin.TxtOCAN(1)) & ", '" & >> StrNulo(FrPrin.CmbOC(10)) & "', " & ValNulo(FrPrin.TxtOCCN(0)) & ", '" & >> StrNulo(FrPrin.CmbOC(11)) & "', " & ValNulo(FrPrin.TxtOCCN(1)) & ", '" & >> StrNulo(FrPrin.TxtMD(1)) & "', '" _ >> >> ' & StrNulo(FrPrin.TxtMD(2)) & "', '" & >> StrNulo(FrPrin.TxtMD(3)) & "', '" & StrNulo(FrPrin.TxtMD(0)) & "', " & >> ValNulo(FrPrin.TxtTot(0)) & ", " & ValNulo(FrPrin.TxtTot(1)) & ", " & >> ValNulo(FrPrin.TxtTot(2)) & ", " & ValNulo(FrPrin.TxtTot(3)) & ", " & >> ValNulo(FrPrin.TxtTot(4)) & ", " & ValNulo(FrPrin.TxtTot(5)) & ", " & >> ValNulo(FrPrin.TxtTot(6)) & ", " & ValNulo(FrPrin.TxtTot(7)) & ", " & >> ValNulo(FrPrin.TxtTot(8)) & ", " & ValNulo(FrPrin.TxtTot(9)) & ", " _ >> >> ' & ValNulo(FrPrin.TxtTot(10)) & ", " & >> ValNulo(FrPrin.TxtTot(11)) & ", " & ValNulo(FrPrin.TxtTot(12)) & ", " & >> ValNulo(FrPrin.TxtTot(13)) & ", " & ValNulo(FrPrin.TxtTot(14)) & ", " & >> ValNulo(FrPrin.TxtTot(15)) & ", '" & StrNulo(TxtNew(8)) & "', " & >> ValNulo(LblFactorPesoVol) & ", '" & StrNulo(TxtNat(1)) & "', '" & >> StrNulo(TxtNat(2)) & "', '" & StrNulo(TxtNat(3)) & "', '" & >> StrNulo(TxtNat(4)) & "', '" & StrNulo(TxtNat(5)) & "', '" & >> StrNulo(TxtNat(6)) & "', '" & StrNulo(TxtNat(7)) & "', '" & >> StrNulo(TxtNat(8)) & "', '" & StrNulo(TxtNat(9)) & "', '" & >> StrNulo(TxtNat(10)) & "', '" & StrNulo(TxtNat(11)) & "', '" & >> StrNulo(TxtNat(12)) & "', '" & StrNulo(TxtNat(13)) & "'," & >> IIf(Agreed.Value, 1, 0) & ", " & IdMaquina >> >> Cn.Execute (CadenaComando & CadenaComando2 _ >> >> & " VALUES (" & CadenaSql & ")") >> >> > > > > -- > Emanuel Calvo Franco > Syscope Postgresql DBA > BaPUG / AOSUG Member > -- > TIP 5: ¿Has leído nuestro extenso FAQ? > http://www.postgresql.org/docs/faqs.FAQ.html > -- Cumprimentos jchavez linux User #397972 on http://counter.li.org/ -- TIP 7: no olvides aumentar la configuración del "free space map"