Dim rs As New ADODB.Recordset Dim SQLString As String Dim index As Integer
For index = 1 To 12 SQLString = "SELECT Sum(index) AS MaenedTotal FROM tabel1 where maende = " & index rs.Open SQLString, CurrentProject.Connection If Not rs.EOF Then MsgBox MonthArray(index) & " " & rs.Fields("MaenedTotal").Value End If rs.Close Next index End Sub
Dim rs As New ADODB.Recordset Dim SQLString As String Dim index As Integer
For index = 1 To 12 SQLString = "SELECT Sum(index) AS MaenedTotal,Count(index) as antal FROM tabel1 where maende = " & index rs.Open SQLString, CurrentProject.Connection If Not rs.EOF Then MsgBox MonthArray(index) & " " & rs.Fields("MaenedTotal").Value & " " & rs.Fields("Antal").Value End If rs.Close Next index End Sub
set ObjConn = Server.Createobject("ADODB.Connection") ' skriv stien til din Access database her - jeg kører MySQL objConn.Open "DSN=Booking;DataBase=Booking;UID=;PWD=;"
Response.Write "måned Sum antal" Response.write "<br>" for index = 1 to 12 SQLString = "SELECT Sum(intcount) AS MaenedTotal,Count(intcount) as antal FROM table1 where Maenede = " & index Set RS = objConn.Execute(SQLString) If Not rs.EOF Then Response.Write MonthArray(Index) & " " & rs("MaenedTotal") & " " & rs("Antal") Response.Write "<br>" End If next
set ObjConn = Server.Createobject("ADODB.Connection") ' skriv stien til din Access database her - jeg kører MySQL objConn.Open "DSN=Booking;DataBase=Booking;UID=;PWD=;"
Response.Write "måned Sum antal" Response.write "<br>" for index = 1 to 12 SQLString = "SELECT Sum(intcount) AS MaenedTotal,Count(intcount) as antal FROM table1 where Maenede = " & index Set RS = objConn.Execute(SQLString) If Not rs.EOF Then Response.Write MonthArray(Index) & " " & rs("MaenedTotal") & " " & rs("Antal") Response.Write "<br>" End If next
set RS = nothing Set ObjConn = nothing
%>
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.