我试图执行一个查询,如“显示表”。但我不知道将由查询返回的列名称。我试过使用类似ASP经典分贝问题
RS.Fields(1).Name
向我展示的名称,但似乎并没有工作。有什么建议么?下面是完整的代码:
Response.Buffer = true
Dim oConn, oRs
Dim qry, connectstr, i
i = 1
connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=xxx.xxx.xxx.xxx;DATABASE=;UID=;PWD="
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr
qry = "show tables"
Set oRS = oConn.Execute(qry)
while not oRS.EOF
Response.Write("<td><b>" & oRS.Fields(i).Name & "</b></td>")
oRS.movenext
i = i + 1
wend
Set oRs = nothing
Set oConn = nothing
+1。这应该工作。 – David 2009-10-05 02:46:56