Question

I've read several other threads that point towards this article

http://msdn.microsoft.com/en-us/library/y7tz3hhk%28v=vs.80%29.aspx

However the example doesn't lend itself to what I want very well. I looked at a few other SQL statements, and I'm not sure I'm using it right. I'm connecting to a DBF file through C# with OleDbConnection and populating an OleDbDataAdapter

 var sql = "select *, recNo() as rownum from '" + Uri.UnescapeDataString(connString) 
+ "' WHERE (rownum > " + lowerLimit + ") AND (rownum > " + upperLimit + ")";

I keep receiving an error message saying that rownum doesn't exist. I tried changing the rownum to CAPS, no difference.

SQL: Column 'ROWNUM' is not found.

In summary, what I'm trying to accomplish is return all rows based on what row it's in. Modifying the DBF file is not an option, and I'd like to save on memory, so just adding everything into a giant table is not a fesible option. (600,000+ records)

Was it helpful?

Solution

Try using the RECNO() in the WHERE clause: WHERE RECNO() > var

Another option would be to use sub queries since rownum doesn't exist yet.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top