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%> 大家看明白了嗎?嘿嘿,不清楚,那就在到論壇中問問各位大蝦吧!