Access SQL 2005 XML type data via ADO 2.8 or below

Posted on 2006-04-04
Medium Priority
Last Modified: 2013-12-25
Can we work with ADO in VB6 to access sql 2005 xml type data?
Question by:SELSupport
  • 2
  • 2
LVL 29

Accepted Solution

leonstryker earned 750 total points
ID: 16370637

Author Comment

ID: 16371416
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.
LVL 75

Expert Comment

by:Anthony Perkins
ID: 16394271
Consider instead using the connection string from the article that leonstryker posted earlier.

Author Comment

ID: 16398376
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 ADO.net 2.0 is fine, but our integration tool is based on VB6/ADO. Just want to confirm this with someone.)

LVL 75

Expert Comment

by:Anthony Perkins
ID: 16405259
If you actually tried with leonstryker's connection string, than I am afraid I have no idea.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question