I'm trying to eliminate the unwanted data from a recordset and write the pure ones to another database table .. i didn't take any error but when i check info from acces i cant see the records that should be where i checked.
I added my full project here:
http://ul.to/wv3pfw8c
u can see my database's password from login form's code window.(its alil' bit nasty i dont want to write it down here. ) Any helps appreciated..
Code:Dim conn As New ADODB.Connection Dim TempSet1 As New ADODB.Recordset Dim TempSet2 As New ADODB.Recordset Dim TempSet3 As New ADODB.Recordset Dim TempSet4 As New ADODB.Recordset conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & App.Path & "\Math.accdb;Jet OLEDB:Database Password=****you216;" conn.Open TempSet1.ActiveConnection = conn TempSet1.CursorLocation = adUseClient TempSet1.Open ("select OGRNO,Ad,Soyad from Ogrenci") TempSet2.ActiveConnection = conn TempSet2.CursorLocation = adUseClient TempSet2.Open "SELECT ogrenci,Adsoyad FROM Notlar WHERE DersKodu=" & Ana_Sayfa.dk TempSet3.ActiveConnection = conn TempSet3.CursorLocation = adUseClient Do While Not TempSet1.EOF TempSet2.MoveFirst Do While Not TempSet2.EOF If TempSet1.Fields("OGRNO") <> TempSet2.Fields("Ogrenci") Then TempSet3.Open "insert into TempOgrenci (Ad,Soyad,OGRNO) values (" & TempSet1.Fields("OGRNO") & ",'" & TempSet1.Fields("Ad") & "','" & TempSet1.Fields("Soyad") & "')" End If TempSet2.MoveNext Loop TempSet1.MoveNext Loop TempSet4.ActiveConnection = conn TempSet4.CursorLocation = adUseClient TempSet4.Open "select OGRNO,Ad,Soyad from TempOgrenci" DataGrid1.DataSource= TempSet4





Reply With Quote
