New topic: 

Send very commands for Recordset BD Mysql ,Help.....

<http://forums.realsoftware.com/viewtopic.php?t=48015>

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        fernandopm          Post subject: Send very commands for 
Recordset BD Mysql ,Help.....Posted: Wed May 29, 2013 6:57 pm                   
      
Joined: Sat Jun 11, 2011 8:46 pm
Posts: 31                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                DaveS          Post subject: 
Re: Send very commands for Recordset BD Mysql ,Help.....Posted: Wed May 29, 
2013 7:58 pm                                 
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4927
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                fernandopm          Post 
subject: Re: Send very commands for Recordset BD Mysql ,Help.....Posted: Wed 
May 29, 2013 8:28 pm                         
Joined: Sat Jun 11, 2011 8:46 pm
Posts: 31                Thank's is Correct   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to