Real Software Forums
http://forums.realsoftware.com/

Send very commands for Recordset BD Mysql ,Help.....
http://forums.realsoftware.com/viewtopic.php?f=3&t=48015
Page 1 of 1

Author:  fernandopm [ Wed May 29, 2013 6:57 pm ]
Post subject:  Send very commands for Recordset BD Mysql ,Help.....

In my code is:

If db.Connect then //If the database connected:
//Clear the listbox
Listlogros.DeleteAllRows

Dim sql22 as string = "select aa.descripcion,aa.codigoa,aa.equipoa,aa.logromla,aa.spreadruna,aa.logroruna,aa.valoralta,aa.logroalta,"
Dim sql23 as string = "aa.codigob,aa.equipob,aa.logromlb,aa.spreadrunb,aa.logrorunb,aa.valorbaja,aa.logrobaja,"
Dim sql24 as string = "bb.codigoa,bb.logromla,bb.spreadruna,bb.logroruna,bb.valoralta,bb.logroalta,"
Dim sql25 as string = "bb.codigob,bb.logromlb,bb.spreadrunb,bb.logrorunb,bb.valorbaja,bb.logrobaja,"
Dim sql26 as string = "cc.codigoa,cc.logromla,cc.codigob,cc.logromlb,"
Dim sql27 as string = "dd.codigoa,dd.logromla,dd.codigob,dd.logromlb,"
Dim sql28 as string = "ee.codigoa,ee.valoralta,ee.logroalta,ee.codigob, ee.valorbaja,ee.logrobaja"
Dim sql29 as string = "FROM logrosclie as aa,logrosclie as bb,logrosclie as cc,logrosclie as dd,logrosclie as ee"
Dim sql30 as string = "where aa.codigoa = (bb.codigoa-1000) and aa.codigoa = (cc.codigoa-5000) and aa.codigoa = (dd.codigoa-6000) and aa.codigoa = (ee.codigoa-7000) and aa.codigoa < 999 group by bb.codigoa"

//Define the record set

cadena1 = sql22 + sql23 + sql24 + sql25 + sql26 + sql27 + sql28 + sql29 + sql30
MsgBox ("Ver secuencia de comandos ") + cadena1
dim rs as RecordSet = db.SQLSelect(cadena1)

While Not rs.EOF
Listlogros.addrow (rs.Field("codigoa").StringValue, rs.Field("equipoa").StringValue, rs.Field("logromla").StringValue)
rs.MoveNext

Wend

rs.close


else //The database is hiding from us
MsgBox ("No me puedo conectar al servidor mysql")
end if

but halt into line WHILE NOT RS.EOF, which is the error?

Author:  DaveS [ Wed May 29, 2013 7:58 pm ]
Post subject:  Re: Send very commands for Recordset BD Mysql ,Help.....

because you SQL is wrong...... well kind of wrong

you created 9 strings (why not just one?).. but anyways when you concat them together you forgot the SPACES between the last word of each line and the first word of the next line ...

ee.codigoa,ee.valoralta,ee.logroalta,ee.codigob, ee.valorbaja,ee.logrobajaFROM logrosclie as aa,logrosclie as bb,logrosclie as cc,logrosclie as dd,logrosclie as eewhere aa.codigoa = (bb.codigoa-1000)



That is why error checking should ALWAYS be used...

Author:  fernandopm [ Wed May 29, 2013 8:28 pm ]
Post subject:  Re: Send very commands for Recordset BD Mysql ,Help.....

Thank's is Correct :)

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/