>MySQL doesn't use '=='. Change them to '='.

Yup, I figured it had to be something like that.

So now, my next problem is this:

When my query runs, I get a "Please wait...requerying dataset..." window 
that doesn't go away. The grid does not populate, and an error having to do 
with the bizobj's KeyField property is generated.

I guess the notion of the bizobj's KeyField is incompatible with UserSQL in 
some way, and so there's something else on the bizobj that I need to set, 
but I don't know what it is.

Code and traceback follow.

Ken

## *!* ## Dabo Code ID: dForm-top
def afterInit(self):
         self.setupBizobj()

def afterInitAll(self):
         self.populateGrid()

def populateGrid(self):
         self.requery()

         # I get "Please wait...requerying dataset....". That window doesn't
         # go away--not until I close the Class Designer. And, an error having
         # to do with the bizobj's KeyField property is generated.
         myData = self.PrimaryBizobj.getDataSet()

         # This does not print.
         print myData

         # Grid does not display anything.
         self.songGrid.DataSet = self.PrimaryBizobj.getDataSet()

def setupBizobj(self):
         
self.Application.addConnectFile("C:\DaboProjects\MyMusic\mymusic.cnxml")

         conn = self.Application.getConnectionByName("main")

         biz = dabo.biz.dBizobj(conn)

         # No DataSource; we'll use DataSet instead.

         # I've tried commenting this out entirely, or using "pkid" or 
"musRecs.pkid" here.
         # In all cases the error has to do with KeyField. It also doesn't 
matter
         # whether or not musRecs.pkid is in SELECT clause of the query. 
And, it doesn't
         # matter whether there's a LIMIT clause in the query. I put it in 
because I thought
         # it just might be taking the data engine a really long time to 
deal with these
         # joins. But I can let it sit for 15 minutes and it produces nothing.
         biz.KeyField = "musRecs.pkid"

         biz.UserSQL = 'SELECT musSongs.songname, (SELECT CASE 
musPerfs.arttype WHEN "P" ' \
                 + 'THEN musPeople.lastname ' \
                 + 'WHEN "B" THEN musBands.bandname ELSE " " END ' \
                 + 'FROM musPerfs ' \
                 + 'JOIN musPeople ON musPeople.pkid = musPerfs.artid ' \
                 + 'JOIN musBands ON musBands.pkid = musPerfs.artid ' \
                 + 'WHERE musPerfs.songid = musSongs.pkid) AS artist, ' \
                 + 'musRecs.pkid ' \
                 + 'FROM musSongs ' \
                 + 'JOIN musPerfs ON musPerfs.songid = musSongs.pkid ' \
                 + 'JOIN musRecs ON musRecs.perfid = musPerfs.pkid ' \
                 + 'LIMIT 5'

         self.addBizobj(biz)

         # If I do this I get the KeyField error right here and the form 
doesn't run.
         #biz.requery()




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.6/708 - Release Date: 3/2/2007 4:19 PM



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to