StackOverflow in VB.NET SQLite query
It's hard to be sure without the stack trace, but I'd imagine that somewhere you have a recursive call to a function that increases the call stack size on each iteration. The StackOverflowException
error comes from the SQLite library, but I suspect that most of the calls on the stack at this point are your own functions. The call into the SQLite library was the call that broke the camel's back, but that's not necessarily where the error is.
Post the (interesting parts of the) stack trace and perhaps we can tell you more precisely where your error is.