Access SQL 2005 XML type data via ADO 2.8 or below

Can we work with ADO in VB6 to access sql 2005 xml type data?
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.


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
SELSupportAuthor Commented:
Actully I have a query below:

select ref.value('@id', 'varchar(20)') p0,ref.value('@comp', 'varchar(20)') p1, ref.value('@barc3', 'varchar(20)') p2
from Table_xml cross apply xmlcol.nodes('TraceabilityData/charge') as Tab(ref)
where id=6 order by p0

I can run it through QA (sql analyzer),but when I run it in VB6 with ADO 2.7, with a connect string:

cnn.Open "Provider=SQLNCLI;Trusted_Connection=yes;Database=" & DataSource & ";Server=" & Servername, cnn, adOpenStatic

An error occured, said " run-time error '-2147217900(80040e14)' ".

Instead if it's a simple select statement like this:

select * from Table_xml where id=6

no problem to get all xml formatted data.

Please advise me. Thanks.
Anthony PerkinsCommented:
Consider instead using the connection string from the article that leonstryker posted earlier.
SELSupportAuthor Commented:
I tried, just got the same error. Here is the details:

Run-time error '-2147217900(80040e14)':

SELECT failed beacuse the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexs on computed columns and/or query notifications and/or xml data type methods.

I was wondering if ADO 2.8 or below supports xml data methods in sql 2005? (saw somewhere mentioned 2.0 is fine, but our integration tool is based on VB6/ADO. Just want to confirm this with someone.)

Anthony PerkinsCommented:
If you actually tried with leonstryker's connection string, than I am afraid I have no idea.
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
Visual Basic Classic

From novice to tech pro — start learning today.