<% Lokalnamn=request.querystring("Lokalnamn") Datatab=request.querystring("Datatab") Const adLockReadOnly = 1 Const adOpenStatic = 1 Dim rsdatum, rsparam, conn, rs, sql, Lokalnamn, Parameter, no_values, no_params, objBuilder, i, j, part, m, n, o set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("..\..\odbc\lagandata.mdb")) set rs=Server.CreateObject("ADODB.recordset") sql="SELECT lokalnamn.Lokalnamn, " & Datatab & ".* FROM (lokalnamn INNER JOIN " & Datatab & " ON lokalnamn.nr=" & Datatab & ".lokalnamn_nr) WHERE" sql=sql & " lokalnamn.Lokalnamn='" & Lokalnamn & "'" sql=sql & " ORDER BY Datum" rs.Open sql,conn %> Tabelldata för <% =Lokalnamn %>

Högerklicka i tabellen och välj "markera allt". Kopiera och klistra in i exempelvis ett kalkylark.

<% response.write "" & vbCrLf response.write "" & vbCrLf for i = 4 to rs.fields.count - 1 posleft = InStr(rs.fields(i).Name, "(") if posleft = 0 then param = rs.fields(i).Name unit = "" else posright = Len(rs.fields(i).Name) - posleft unit = Right(rs.fields(i).Name, posright+1) param = Left(rs.fields(i).Name, posleft-2) end if response.write "" & vbCrLf next response.write "" & vbCrLf %> <% Do until rs.EOF response.write "" & vbCrLf response.write "" & vbCrLf for i = 4 to rs.fields.count - 1 response.write "" & vbCrLf next response.write "" & vbCrLf rs.MoveNext Loop response.write "
" & rs.fields(0).Name & "" & rs.fields(3).Name & "" & param & "
" & unit & "
" & rs.fields(0) & "" & rs.fields(3) & "" if IsNull(rs.fields(i)) then response.write " " else response.write rs.fields(i) end if response.write "
" rs.close conn.Close set rs=Nothing set conn=Nothing %>