DSNless联结需你知道数据库文件的名字(I.e. File based databases like Access, Paradox, FoxPro, etc.)或者数据库的服务器地址(SQL Server就是这样的)。还必须有打开这个数据库的权限,比如密码和用户名。有了这些你就可以打开这个数据库了!嘿嘿!
<% sub query2table(inputquery, inputDSN) dim conntemp, rstemp set conntemp=server.createobject("adodb.connection") conntemp.open inputDSN set rstemp=conntemp.execute(inputquery) howmanyfields=rstemp.fields.count -1%> <table border=1><tr> <% 'Put Headings On The Table of Field Names for I=0 to howmanyfields %> <td><b><%=rstemp(I).name%></B></TD> <% next %> </tr> <% ' Now lets grab all the records do while not rstemp.eof %> <tr> <% for I = 0 to howmanyfields thisvalue=rstemp(I) If isnull(thisvalue) then thisvalue=" " end if%> <td valign=top><%=thisvalue%></td> <% next %> </tr> <%rstemp.movenext loop%> </table> <% rstemp.close set rstemp=nothing conntemp.close set conntemp=nothing end sub%> 大家看明白了吗?嘿嘿,不清楚,那就在到论坛中问问各位大虾吧!