Buongiorno,
ho una tabella su SQL Server 2008 con un campo formattato XML del tipo:
<rows><row attributo="49"/><row attributo="19"/><row attributo="61"/><row attributo="265"/></rows>
tramite la seguente query eseguo la selezione:
SELECT AR.Cd_AR FROM dbo.AR WHERE AR.Attributi.exist('/rows[(row/@attributo=47) AND (row/@attributo=19)]') = 1);
ed in ambiante SQL tutto funziona.
Ho provato in una pagina ASP a far esguire la query ma non ne vengo fuori perchè mi da errore e sono completamente a digiuno di XML.
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "Driver={SQL Server Native Client 10.0};Server=myServer;Database=myDB;Uid=myUser;Pwd =myPassword;"
Dim strSQL, Rs
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open strSQL, Conn, 3, 3
RESPONSE.WRITE Rs("Cd_AR")
RESPONSE.WRITE Rs("Id_Attributo")
Ho provato anche a cambiare la stringa di connessione con la seguente:
Conn.open "Provider=SQLXMLOLEDB.4.0;Data Provider=SQLNCLI10;Data Source=localhost;Initial Catalog=myDB;User Id=myUser;Password=myPassword;"
ma addirittura solo anche la stringa di connessione mi da errore.
Qualche idea o suggerimento ???
Grazie mille