28,391
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="utf-8"?>
<root imageWidth='440' imageHeight='250'>
<menu url="" frame="_blank" imageUrl="images/001.jpg"/>
</root>
<%
Dim Conn,ConnStr,Db
Db = "../Db/#$shsh#wwwibdkei.mdb"
Set Conn = Server.CreateObject("Adodb.Connection")
ConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(Db)
Conn.Open ConnStr
%>
<%
Set oDoc = CreateObject("Msxml2.DOMDocument")
With oDoc
.async = False
.validateOnParse = False
.preserveWhiteSpace = False
.resolveExternals = False
End With
Set oRoot = oDoc.createElement("root")
oRoot.setAttribute "imageWidth", "440"
oRoot.setAttribute "imageHeight", "250"
sql = "SELECT T1, T2 FROM table"
Set oRS = CreateObject("ADODB.Recordset")
oRS.CursorLocation = 3
oRS.Open sql, conn, 1, 1
Do While Not oRS.EOF
Set oNode = oDoc.createElement("menu")
oNode.setAttribute "url", oRS("T1")
oNode.setAttribute "frame", "_blank"
oNode.setAttribute "imageUrl", oRS("T2")
oRoot.appendChild oNode
Set oNode = Nothing
oRS.MoveNext
Loop
oRS.Close
Set oRS = Nothing
conn.Close
Set conn = Nothing
%>
导入没反映字段不显示
Dim Conn,Connstr
Sub OpenDb()
'On Error Resume Next
Set Conn = Server.CreateObject("ADODB.Connection")
Connstr = "driver={SQLServer};server=61.151.239.140;uid=xxxx;database=cqwl68;pwd=xxx"
Conn.Open Connstr
'If Err.Number<>0 Then Response.Write = "数据库连接出错!"
End Sub
Sub CloseDb()
Set Conn = Nothing
End Sub
OpenDb()
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><%
set rs=conn.execute("SELECT * from vote where IsChecked=1 ")
if rs.eof then
response.Write "暂无投票"
else%>
<td><div align="center"><b> <%=rs("Title")%></b></div></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="2" cellpadding="2">
<form action="vote.asp" target="newwindow" method=post name=research>
<tr>
<td valign=top width="100%"><%
for i=1 to 8
if rs("Select"&i)<>"" then
%>
<input style="border: 0" <%if i=1 then%>checked<%end if%> name=Options type=radio value=<%=i%>>
<%=i%>.<%=rs("Select"&i)%><br>
<%
end if
next
%> </td>
</tr>
<tr>
<td width="100%" height=30 align=center><input type="image" border="0" name="submit" src="images/vote1.gif" width="59" height="19" style="cursor:hand"onClick="window.open('vote.asp?stype=view ','basket','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=0,resizable=0,width=510,top=50,left=100,height=370')">
<a href=# onClick="window.open('vote.asp?stype=view ','basket','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=0,resizable=0,width=510,top=50,left=100,height=370')"><img src="images/vote.gif" width="59" height="19" border="0" /> </a></td>
</tr>
</form>
</table>
<%end if%> </td>
</tr>
</table>
Connstr = "Provider=SQLOLEDB;Data source=61.151.239.140;Initial Catalog=cqwl68;User ID=xxx;Password=xxx;"
<%
Set oDoc = CreateObject("Msxml2.DOMDocument")
With oDoc
.async = False
.validateOnParse = False
.preserveWhiteSpace = False
.resolveExternals = False
End With
Set oRoot = oDoc.createElement("root")
oRoot.setAttribute "imageWidth", "440"
oRoot.setAttribute "imageHeight", "250"
sql = "SELECT T1, T2 FROM table"
Set oRS = CreateObject("ADODB.Recordset")
oRS.CursorLocation = 3
oRS.Open sql, conn, 1, 1
Do While Not oRS.EOF
Set oNode = oDoc.createElement("menu")
oNode.setAttribute "url", oRS("T1")
oNode.setAttribute "frame", "_blank"
oNode.setAttribute "imageUrl", oRS("T2")
oRoot.appendChild oNode
Set oNode = Nothing
oRS.MoveNext
Loop
oRS.Close
Set oRS = Nothing
conn.Close
Set conn = Nothing
Set oDoc.documentElement = oRoot
oDoc.save "D:\xxxx\xxxx.xml"
Response.Write oDoc.xml
Set oRoot = Nothing
Set oDoc = Nothing
%>