본문 바로가기

Story/asp

Mssql To Xml

반응형

Mssql To Xml

 

출처 : http://bytes.com/topic/asp-classic/answers/728740-mssql-xml

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Neue Seite 1</title>
</head>

<body>

<%
Dim conn
Dim rs

Set conn = server.createObject("ADODB.Connection")
on Error Resume Next
SSN = Request.QueryString("SSN")
' Verbindung zur Datenbank herstellen
conn.open "PROVIDER=SQLOLEDB;SERVER=123;ADDRESS=212,1234;UID=werer;PWD=666;DATABASE=MydB;"

set rs=Server.CreateObject("ADODB.recordset")

rs.Open "SELECT * FROM Betriebsdaten for XML", conn
do until rs.EOF
for each x in rs.Fields
Response.Write(x.name)
Response.Write(" = ")
Response.Write(x.value & "<br />")
next
Response.Write("<br />")
rs.MoveNext
loop

rs.close
conn.close
%>

</body>
</html>

반응형

'Story > asp' 카테고리의 다른 글

SQL Server 암호화 알고리즘 정리  (0) 2015.03.16
asp file download  (0) 2015.02.06
asp c# .net 에서 mysql password 값을 만들기  (0) 2013.02.05
asp 로 rss feed (reader) 구현하기  (0) 2011.07.01
asp 쿠키(Cookies) 사용  (0) 2011.02.25