Hooking up to a Visual Foxpro db ?
Posted: Thu Mar 12, 2009 11:23 pm
I'm trying to use a native Alpha5 database. I have set up an ODBC datasource, using the Microsoft Visual Foxpro driver (which I think is the correct one; to verify, I linked to this ODBC from Alpha5, and it worked).
In preOpenCard, I have put:
Then we have:
This results in:
so far so good...
recNum: -1; colNum: 38
So it seems to have opened the table, and it knows how many columns are there, but it's not returning any rows. (There are plenty of rows, honest).
Any suggestions as to what I'm doing wrong or missing ?
Many thanks,
Pete
In preOpenCard, I have put:
Code: Select all
put revOpenDatabase("odbc","Copy of Names and Addresses",,,,,,) into tConID
if tConID is "" then
answer warning "Problem accessing database"
end if
put tConID into gConID
Code: Select all
put "SELECT * FROM names;" into dbQuery
put revQueryDatabase(gConID, dbQuery) into curID
if curID is not a number then
answer error "Query failed:" & cr & curID
exit refreshTitleList
end if
answer "so far so good..."
put revNumberOfRecords(curID) into recNum
put revDatabaseColumnCount(curID) into colNum
answer "recNum: " & recNum & "; colNum:" & colNum
so far so good...
recNum: -1; colNum: 38
So it seems to have opened the table, and it knows how many columns are there, but it's not returning any rows. (There are plenty of rows, honest).
Any suggestions as to what I'm doing wrong or missing ?
Many thanks,
Pete