Hjælp til AspImage
Hej!Hvad er der galt her???
<%
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("dbdb.mdb")
Conn.Open DSN
set rs1 = Conn.Execute("SELECT count(*) as antalbesog from count")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '01'"
Set rs = Conn.Execute(SQL)
a = 100/rs1("antalbesog") * rs("Found")
a1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '02'"
Set rs = Conn.Execute(SQL)
b = 100/rs1("antalbesog") * rs("Found")
b1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '03'"
Set rs = Conn.Execute(SQL)
c = 100/rs1("antalbesog") * rs("Found")
c1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '04'"
Set rs = Conn.Execute(SQL)
d = 100/rs1("antalbesog") * rs("Found")
d1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '05'"
Set rs = Conn.Execute(SQL)
e = 100/rs1("antalbesog") * rs("Found")
e1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '06'"
Set rs = Conn.Execute(SQL)
f = 100/rs1("antalbesog") * rs("Found")
f1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '07'"
Set rs = Conn.Execute(SQL)
g = 100/rs1("antalbesog") * rs("Found")
g1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '08'"
Set rs = Conn.Execute(SQL)
h = 100/rs1("antalbesog") * rs("Found")
h1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '09'"
Set rs = Conn.Execute(SQL)
i = 100/rs1("antalbesog") * rs("Found")
i1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '10'"
Set rs = Conn.Execute(SQL)
j = 100/rs1("antalbesog") * rs("Found")
j1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '11'"
Set rs = Conn.Execute(SQL)
k = 100/rs1("antalbesog") * rs("Found")
k1 = rs("Found")
SQL = "SELECT count(*) as Found from count where mid(dato,4,2) = '12'"
Set rs = Conn.Execute(SQL)
l = 100/rs1("antalbesog") * rs("Found")
l1 = rs("Found")
%>
<%
' ****************************************************************
' Dette script kan benyttes gratis, frit, og uden at indhente tilladelse først
' - dog må selve kildekoden ikke distribueres på andre sites end html.dk
' Kontakt info@html.dk hvis du er i tvivl
' ****************************************************************
arrVinkler = Array(round(a),round(b),round(c),round(d),round(e),round(f),round(g),round(h),round(i),round(j),round(k),round(l))
arrFarver = Array(FF0000,0000FF,FFFF00,00FF00,00FFFF,FF00FF,808000,800080,008000,C0C0C0,008080,800000)
intS = 90 'Størrelsen på lagkagen
Set Image = Server.CreateObject("AspImage.Image")
Image.MaxX = intS
Image.MaxY = intS
X_2 = (0.5*intS)
Y_2 = 0
For i = 0 to Ubound(arrVinkler)
X_1 = (0.5*intS)
Y_1 = (0.5*intS)
X_R = (X_2 - X_1)
Y_R = (Y_2 - Y_1)
pi = 4 * Atn(1)
CosAng = Cos(arrVinkler(i)*pi/180)
SinAng = Sin(arrVinkler(i)*pi/180)
X_3 = ((X_R*CosAng)-(Y_R*SinAng))+X_1
Y_3 = ((Y_R*CosAng)+(X_R*SinAng))+Y_1
Image.BackgroundColor = arrFarver(i)
Image.Pie 0, 0, intS, intS, X_2, (intS-Y_2), X_3, (intS-Y_3)
X_2 = X_3
Y_2 = Y_3
Next
Response.ContentType = "image/gif"
Response.BinaryWrite Image.Image
Set Image = nothing
%>
Jeg får ikke nogen fejl meddellese
