C/ODBC ADO & SQL problems

Tried importing data (Posted Invoice & Cr Memo tables & Posted lines tables) to bring data in from NF 2.00 into Excel 2000, using C/ODBC and First case: using SQL (following example on Navision CD) Problem here was that no matter what I tried I could not get it to bring in more than 16384 lines. MS says 16384 is max number of lines for Excel 97 and fixed it for Excel 2000, but couldn’t not get more than 16384 lines. It would process the additional data but it just owuld not write the rows. So, I swithc to: Second Case: using ADO Problem here is that, I can get the data for the Invoice Header Table and the Cr Memo Header table, and then the Invoice Line table but when it gets to the point of doing the Cr Memo Line table I get the following errors: “The instruction at 02d32502 referenced memory at fffffffff The memory could not be read from.” followed by: “Slave caused an invalid page fault in module dbm.dll at 0167:02d32502” At first, I got this only a couple of times, but got it all the time. So I did clean install of Windows 98, Navision, Office 2000 & C/ODBC Since clean install get it all the time. I can have routine skip Cr Memo Lines and it works fine or alternatively have it skip Invoice Lines and do Cr Memo Lines, also works fine. What can I do?

Well, got report working. Tried DAO as well - had problem with error at OpenRecordset line. Anyway, in all versions (SQL, ADO, DAO) had it loop thru the 4 tables and with each loop open & then close the connection. In the ADO version, rewrote so that it opens & closes connection once & within that loops thru each of the 4 tables. Seems to work fine. Also, had tried ADO version on a win2k machine (had been using win98 machine) and it worked fine without rewrite. Posting this as follow up and in case others have problems.

Moved to SQL Forums.