ODBC connection to MS SQL 2000 help needed

Jan Schenkel janschenkel at yahoo.com
Thu Mar 30 12:34:50 EST 2006

--- mfstuart at cox.net wrote:
> Hi all,
> [snip]
> Problem is, the select returns no data (when I know
> there is data) and the Counter = -1 for Matching
> records.
> I’ve tried with and without the semicolon “;” in the
> “on mouseUp” for the “Select” button.
> Here’s the select statement:
> SELECT account_number as "Account No", account_name
> as "Account Name" FROM account;
> [snip]
> Any help will be much appreciated, thanx.
> Mark

Hi Mark,

There's nothiong worng with your SELECT query ; the
problem is in the ODBC database driver not always
returning the correct record count. I've seen this
with Access and Progress databases as well.

Hopefully, the next revision opf the database drivers
will improve on this problem. The easiest workaround
for now is to traverse the record set until
revdb_iseof() returns true.
repeat until revdb_iseof(tCursorID)
  get revdb_movenext(tCursorID)
  ## do something with the data in the currentrecord
end repeat

Unfortunately, some databases only support read-only
forward-only cursors -- so you should traverse the
record set and fetch all the data you want in one go.

Hope this helped,

Jan Schenkel.

Quartam Reports for Revolution

"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Use-livecode mailing list