Torna al Thread

Dim db As Database Dim rs As Recordset Dim WS As Workspace Dim dbfile As String Dim pwdstring As String ListView1.ListItems.Clear Text2.Text = FormatDate(Text2.Text, dd´mm´yyyy) Text3.Text = FormatDate(Text3.Text, dd´mm´yyyy) Set WS = DBEngine.Workspaces(0) dbfile = (App.Path & "\Data\date.mdb") pwdstring = "swordfish" Set db = DBEngine.OpenDatabase(dbfile, False, False, ";PWD=" & pwdstring) Set rs = db.OpenRecordset("SELECT * FROM pagamenti") Do While Not rs.EOF If Not rs.EOF And Not rs.BOF And rs("gennaio") = "0" And rs("gennaio1") >= Text2.Text And rs("gennaio1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("febbraio") = 0 And rs("febbraio1") >= Text2.Text And rs("febbraio1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("marzo") = 0 And rs("marzo1") >= Text2.Text And rs("marzo1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("aprile") = 0 And rs("aprile1") >= Text2.Text And rs("aprile1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("maggio") = 0 And rs("maggio1") >= Text2.Text And rs("maggio1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("giugno") = 0 And rs("giugno1") >= Text2.Text And rs("giugno1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("luglio") = 0 And rs("luglio1") >= Text2.Text And rs("luglio1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("agosto") = 0 And rs("agosto1") >= Text2.Text And rs("agosto1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("settembre") = 0 And rs("settembre1") >= Text2.Text And rs("settembre1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("ottobre") = 0 And rs("ottobre1") >= Text2.Text And rs("ottobre1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("novembre") = 0 And rs("novembre1") >= Text2.Text And rs("novembre1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("dicembre") = 0 And rs("dicembre1") >= Text2.Text And rs("dicembre1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("trimestre") = 0 And rs("trimestre1") >= Text2.Text And rs("trimestre1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("semestre") = 0 And rs("semestre1") >= Text2.Text And rs("semestre1") <= Text3.Text Or _ Not rs.EOF And Not rs.BOF And rs("annuale") = 0 And rs("annuale1") >= Text2.Text And rs("annuale1") <= Text3.Text Then ListView1.ListItems.Add , , rs("nome") , , 1 End If rs.MoveNext Loop
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5