Pervasive SQL error when filling oledb data adaptor

I just finished adding oledb connectivity to an application,
I had to make it continue to work with the existing ODBC connections
I wrote and tested it on verisons 7.9 2000i and 8.6
now i am getting an error on a client who is using version

it is

Error in GetAList  on line 6 :   [LNA][Pervasive][ODBC Engine Interface]Invalid cursor position; no keyset defined.

here is my code: it works in other places but why is it blowing up here?>

   If UseOLEDB = True Then
6:              DRPMSoledb.Fill(DSPMS, "PMI")
7:              DRPMS.Fill(DSPMS, "PMI")
            End If

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hainansyndromeAuthor Commented:
also getting this error spradically
 No error message available, result code: E_UNEXPECTED(0x8000FFFF). 3
mirtheilSoftware DeveloperCommented:
I've seen the "Invalid cursor position; no keyset defined" error when executing an SQL statement that orders on a non-indexed field and has a VarChar field greater than 300 bytes.  

PSQL 9.50 was updated to PSQL 9.71.  It might be worth trying with the update.  
hainansyndromeAuthor Commented:
mirtheil I am working with a clients PC and they are not upgrading, so ordering on an indexed file will fix it you think?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

mirtheilSoftware DeveloperCommented:
Maybe.  What does your query look like?  Does it sort on a non-indexed field? Does the database have large VarChar fields (greater than 300 bytes)?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hainansyndromeAuthor Commented:
it has in it 1 area, i changed it to remove the convert and SQL_Varchar and order on "Acct ID" but I am still getting that. error

Distinct rtrim(convert(""Acct ID"",SQL_Varchar)) as AccountID
hainansyndromeAuthor Commented:
I was in error i am getting another error
Distinct rtrim(convert(""Patient ID"",SQL_Varchar)) as PMPatientID

 [LNA][Pervasive][ODBC Engine Interface]Numeric value out of range.
[LNA][Pervasive][ODBC Engine Interface]Expression evaluation error.
mirtheilSoftware DeveloperCommented:
Just to be clear, this application was working with PSQL ODBC but using OLEDB, you get these two error messages.  Is that correct?  All you did was change the connection string to use OLEDB (and use OleDb objects instead of ODBC objects), right?
hainansyndromeAuthor Commented:
yes thats it correct I Added the ability ti use an oledb connection string and data adaptor
hainansyndromeAuthor Commented:
once i too the convert id to a varchar it worked
i converted to an a string in code
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.