Using FileMaker as ODBC Source
Javier Miranda
jemirandav at gmail.com
Tue Sep 15 00:35:22 EDT 2015
Hi friends, can you take a look to this code please?
on mouseUp
put "ODBC" into theDBType
put "localhost" into theDBHost
put "SACyV" into theDBName
put "Admin" into theDBUser
put “bcdea" into theDBPassword
put revOpenDatabase( theDBType, theDBName , theDBHost, theDBUser, theDBPassword ) into theConnectionID
put revQueryDatabase( theConnectionID, "SELECT * FROM Almacen") into theCursor
revMoveToLastRecord theCursor
--put the result (It puts false in the msg)
put revCurrentRecord(theCursor) + 1 into field RegAct
put revDatabaseColumnNamed(theCursor, TotRec) & return & Total into field RegNum
set the endValue of Scrollbar Marcador to revCurrentRecord(theCursor) + 1
set the thumbposition of Scrollbar Marcador to 1
put revDatabaseColumnNamed(theCursor, ItemID) into field ItemID
put revDatabaseColumnNamed(theCursor, Producto) into field Producto
put revDatabaseColumnNamed(theCursor, Marca) into field Marca
end mouseUp
It successfully establishes a connection to a datasource (A FileMaker 13 database), makes SQL query, put some values into certain fields in the card and put the fields of the record in the corresponding cards fields.
The problem is doesn’t “like” revMoveToLastRecord theCursor.
I tried to use these commands To navigate the records in the result set:
- revMoveToFirstRecord <cursor id>
- revMoveToPreviousRecord <cursor id>
- revMoveToNextRecord <cursor id>
- revMoveToLastRecord <cursor id>
But none of them seems to work. Is this a limitation of the ODBC driver? And if it is, what have to be done to navigate the records in the cursor?
Saludos,
Javier
More information about the use-livecode
mailing list