Tema: Re: Kuom rasyt toki daikta?
Autorius: Vitas
Data: 2015-06-26 15:41:20
Nuobodžiauju, tai parašiau tau pilną programą, tik pasikoreguok užklausą ir 
eksportą :)

 Dim FDefPath, FSys, SConn, OutFileName
 Dim SQL, Serveris, duomb

 Serveris = InputBox("Serveris:",":)")
 duomb = InputBox("Duomenu baze:",":)")


 Set SConn = CreateObject("ADODB.Connection")

 SConn.Open
 "conn=Application;Name=MQIS;Provider=sqloledb;Trusted_Connection=yes;Server="& Serveris &";Database="& duomb'uzklausa SQL = "select * from table"SConn.Execute(SQL)'eksportuojam i xmlSet objFile = CreateObject("Scripting.FileSystemObject")failo_vardas= InputBox("Iveskite pavadinima:")Set objMyFile = objFile.CreateTextFile("C:\"& failo_vardas & ".xml", True)objmyfile.writeLine("<?xml version=""1.0"" encoding=""utf-8""?>")objmyfile.writeLine("<Sailo_xml>")Set rst_uzklausa = SConn.Execute(SQL)Do While not rst_uzklausa.eofobjmyfile.writeLine("  <sailo_data> " &rst_uzklausa("kazkoks_stulpelis")&</sailo_data>" )rst.movenextLoopobjmyfile.writeLine("</Sailo_xml>")objMyFile.CloseConn.Close