<%@ Page Language="vb" Debug="true" %> <% @Import NameSpace="System.Data" %> <% @Import NameSpace="System.Data.SQLClient" %> <% @Import NameSpace="System.Diagnostics.Debug" %> <% @Import Namespace="System.Web.Mail" %> <% @Import Namespace="System.Text.RegularExpressions" %> <% @Import NameSpace="System.Data.OleDb" %> <%@ Import namespace="System.IO" %> <%@ Import namespace="System.Net" %> <% Dim filename filename = "DB_to_XML.xml" Dim fso fso = Server.CreateObject("Scripting.FileSystemObject") if fso.FileExists(Server.MapPath(filename)) then fso.DeleteFile(Server.MapPath(filename)) end if fso = Nothing Dim cn, rs, sql Dim strConn = ("server=62.149.153.12; initial catalog=MSSql11819;uid=MSSql11819;pwd=72a256bf") Dim sqlConn As New SqlConnection(strConn) Dim SqlComm as New SqlCommand 'Set cn = server.createobject("ADODB.Connection") 'cn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="Server.MapPath("myDataBase.mdb")) sql = "SELECT * FROM Missioni" rs = New SqlCommand(sql,sqlConn) rs.Save (Server.MapPath(filename), 1) rs.Close rs = Nothing cn.Close sqlConn = Nothing Response.Write("Per visualizzare il file XML appena creato clicca qui.") %>