Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Jun 29, 2017 10:53 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Send very commands for Recordset BD Mysql ,Help.....
PostPosted: Wed May 29, 2013 6:57 pm 
Offline

Joined: Sat Jun 11, 2011 8:46 pm
Posts: 33
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Send very commands for Recordset BD Mysql ,Help.....
PostPosted: Wed May 29, 2013 7:58 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
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...

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Send very commands for Recordset BD Mysql ,Help.....
PostPosted: Wed May 29, 2013 8:28 pm 
Offline

Joined: Sat Jun 11, 2011 8:46 pm
Posts: 33
Thank's is Correct :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group