ODBC, SQL Server, "FOR XML" & Cursors error

From: Thomas Keegan (thomasjkeegan_at_yahoo.co.uk)
Date: 10/14/04


Date: Thu, 14 Oct 2004 09:00:07 -0700

Hi,
 

Has anybody had any luck using the Microsoft SQLServer
ODBC drivers (Driver version: 03.81.9030, ODBC version :
03.52)

to connect to a SQL Server 2000 database and passing in a
SELECT with a FOR XML clause. I keep

getting Error [Microsoft][ODBC SQL Server Driver][SQL
Server]The FOR XML clause is not allowed in a CURSOR
statement

., State: 42000, Error: 6819.

Is there a work around (eg putting the select in a stored
procedure) or am I missing something ?

I am using SQLExecDirect() to execute the statement.

Or could any one suggest a better way to retrieve data
from a standard table in XML formated string?
 

Please Help!!



Relevant Pages

  • Re: Choosing Class Problem CDatabase OR CDaoDatabase
    ... The CDatabase/CRecordset class is for use with any database that has an ODBC ... There are ODBC drivers for most mainstream database providers, ... especially SQL Server, Oracle, MS Jet, MySql, FoxPro, etc. ...
    (microsoft.public.vc.mfc)
  • Re: Windows Services and SQL Server
    ... I am trying to access my SQL Server 2005 database with a windows service, ... authenticate using the machine account with a $ appended on the network. ... Why using legacy ODBC drivers when there are managed stacks available for most DB's systems on the market? ...
    (microsoft.public.dotnet.languages.csharp)
  • Connecting to MS Sql Server Compact 3.5
    ... This may be a stupid newbie question, but I hope someone can point me in the right direction. ... I have a database created with MS SQL Server Compact Edition 3.5 that I wish to access from VFP. ... My understanding is that there are no ODBC drivers for 3.5, so does anyone have a good idea on what is the best way of accessing it. ...
    (microsoft.public.fox.helpwanted)
  • Re: ODBC connection to mdb for MacIntosh
    ... I was using FoxPro database files at the time. ... >> Access driver for Office 98 or 2001 or any version of Mac office. ... >> complete thread in the Excel for Mac newsgroup about ODBC drivers. ... but it might turn out that you can use XML to treat Excel ...
    (microsoft.public.mac.otherproducts)
  • Re: ODBC connection to mdb for MacIntosh
    ... The studioMX is Mac version. ... As long as the computer has ODBC drivers for an Access ... I was using FoxPro database files at the time. ... but it might turn out that you can use XML to treat Excel ...
    (microsoft.public.mac.otherproducts)