Hello again,

I have a strange little problem with my database (Mysql) queries.
I make many queries and updates together with the click of a button.

When I make the queries and updates without using any of the results then 
everything works fine !!
When I want to use a part of the results I get the invalid object error and 
all of the results turn to red ( do not work).

AT the example below I get the error message "invalid object" at the PRINT 
#hPrinter line and the problem is on the rsAPOD!arithmosAp  result which is 
LongInteger (at the end of the PRINT line).

here is the code:

PUBLIC SUB Kataxwrisi_Click()
    DIM hPrinter AS File
    DIM $Result5 AS Result
    DIM $ResultAPOD AS Result
    DIM rsAPOD AS Result
    DIM rsGRAMMI AS Result
    DIM $ResultE5 AS Result
    DIM TrexousaGrammi AS Long
    DIM proigoumenos AS Long
   
    MODMain.Connect
        MODMain.$Con.Begin()
                 $Result5 = MODMain.$Con.Create("BiblioPortas") 
                 $Result5!trexousaHmerominia = Date(Now)
                 $Result5!Poson = Val(TextBox2.Text)
                 $Result5.Update()
    MODMain.$Con.Commit()
    
   
    
    MODMain.Connect()
          rsAPOD = MODMain.$Con.exec("select * from AApodixi order by 
arithmosAp desc")
    MODMain.$Con.Close
    
    
        MODMain.Connect
        MODMain.$Con.Begin()
                 $ResultE5 = MODMain.$Con.Create("Ektyposis") 
                 $ResultE5.Update()
        MODMain.$Con.Commit()
    
           MODMain.Connect()
            rsGRAMMI = MODMain.$Con.exec("select * from Ektyposis order by 
Grammi desc")
        TrexousaGrammi = rsGRAMMI!Grammi
        MODMain.$Con.Close

hPrinter = OPEN "/dev/lp1" FOR OUTPUT
    hPrinter.EndOfLine = gb.Windows

   PRINT #hPrinter, "Anaxorisi" & " " & Format$(Date(Now), "dd.mm.yyyy") & " 
A/A " & tArithmos.Text & " " & tEpitheto.Text & " " & tOnoma.Text & " " & 
tEthnikotita.Text & " " & "Poson " & TextBox2.Text & " Ar.Apodixis " & 
rsAPOD!arithmosAp
    
    IF TrexousaGrammi MOD 55 = 0 THEN
            PRINT #hPrinter, Chr$(12);
            PRINT #hPrinter, " "
            PRINT #hPrinter, " "
            PRINT #hPrinter, " "
            PRINT #hPrinter, " "
          ENDIF   
    CLOSE hPrinter
   

     MODMain.Connect
        MODMain.$Con.Begin()
                  'MODMain.$Con.exec("UPDATE `pelates`.`egrafes` SET 
`anaxwrisi` = '" & Date(Now) & "' WHERE `egrafes`.`AA` = '" & tArithmos.Text & 
"' LIMIT 1 ")
                  MODMain.$Con.exec("UPDATE `pelates`.`egrafes` SET  
`egrafes`.`epitheto` = '" & tEpitheto.Text & 
"',........................................etc...................................',
 
`egrafes`.`timifix` = '" & CFloat(ttimifix.Text) & "' WHERE `egrafes`.`AA` = 
'" & tArithmos.Text & "'  LIMIT 1 ")
                  MODMain.$Con.exec("UPDATE `pelates`.`egrafes` SET 
`egrafes`.`ekptosi` = '" & tekptosi.Text & "', `egrafes`.`elenchosAnax` = 1, 
`egrafes`.`xreosi` =0, `egrafes`.`prokatavoli` = '" & 
CFloat(tprokatavoli.Text) & "' WHERE `egrafes`.`AA` = '" & tArithmos.Text & "'  
LIMIT 1 ")
        MODMain.$Con.Close
  
        MODMain.Connect
        MODMain.$Con.Begin()
                 $ResultAPOD = MODMain.$Con.Create("AApodixi")
                 $ResultAPOD!Hmerominia = Date(Now)
                 $ResultAPOD!arithmosAp = rsAPOD!arithmosAp + 1
                 $ResultAPOD.Update()
        MODMain.$Con.Commit()
  
  ME.Close
END


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to