MS-Access ODBC WOES!! non-sensical results?

Ops ops at myesa.com
Sat Jan 3 19:46:28 EST 2004


I have some (brutal) code below trying to simply test if I can get rev 2.1.2
to read data from an MS-Access table.  I'm getting NO errors opening the
DSN, NO errors on the revquerydatabase and getting a VALID cursorID.  I'm
getting 'empty' from revQueryResult (which indicates "no errors" in the
docs) yet the revnumberofrecords(cursid) is returning a -1!?!????  The docs
say that revnumberofrecords should either return a text error message or
non-negative integer!?!???

HELP!!!!!  I'm new to this and realize (and hope, actually) that I'm doing
something 'newbie'-wrong.....but what is most puzzling is that I'm getting a
negative integer from revnumberofrecords when the docs say that I'm supposed
to get either text or a non-negative integer?? (Obviously) I'm not getting
past the breakpoint to test the code below that, because my repeat loop will
go infinite with "-1 times"....that's not the code I'm worried about though.

THANKS AS ALWAYS!!

on mouseUp
  local titl1,art1
  put empty into field errfld
  put empty into field dispfld
  get revOpenDatabase("ODBC","odbcsongdb",,,,)
  put it into songdbid
  get revquerydatabase(songdbid,"select title,artist from songdb")
  put it into cursid
  put "cursid: " & cursid & cr into field errfld
  put "revquresult: " & revQueryResult(cursid) & cr after field errfld
  put "numrecs: " & revnumberofrecords(cursid) & cr after field errfld
  breakpoint
  if revqueryresult(cursid) is not empty then
    put revqueryresult(cursid) into field errfld
  else
    repeat for revnumberofrecords(cursid) times
      revdatabasecolumnnamed(cursid,"title",titl1)
      revdatabasecolumnnamed(cursid,"artist",art1)
      put "Title: " & titl1 & "  Artist: " & art1 & cr after field dispfld
      revmovetonextrecord cursid
    end repeat
  end if
  revclosecursor cursid
  revclosedatabase songdbid
end mouseUp



More information about the use-livecode mailing list