codice:
Dim sConnect As String
    Dim sSQL, data As String
    Dim dfwConn As ADODB.Connection
    Dim i As Integer


    ' imposta le stringhe
    sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;User ID=Admin;Data Source=" & App.Path & "\estrazioni.mdb;Mode=Share Deny None;Extended Properties=';COUNTRY=0;CP=1252;LANGID=0x0409';Jet OLEDB:System database='';Jet OLEDB:Registry Path='';Jet OLEDB:Database Password='';Jet OLEDB:Global Partial Bulk Ops=2"
    'sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO1,VE1,NZ1 from archivio"
ciao ragazzi, buone feste prima di tutto

ho un problema in quella connessione

i campi come ben sapete sono numerici in questa :
'sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO1,VE1,NZ1 from archivio

a questa devo cambiarli se essi sono usguali tra loro.... esempio

se BA1 = F1 ALLORA LA CONNESSIONE DOVREBBE ESSERE :

'sSQL = "select ID,Data,BA1,FI2,MI1,NA1,PA1,RO1,VE1,NZ1

cioè cambio il campo

ho provato cosi, ho messo questo con scarsissimo risultato :


If BA1 = FI1 Then
sSQL = "select ID,Data,BA1,FI2,MI1,NA1,PA1,RO1,VE1,NZ1 from archivio"
End If
If BA1 = MI1 Then
sSQL = "select ID,Data,BA1,FI1,MI2,NA1,PA1,RO1,VE1,NZ1 from archivio"
End If
If BA1 = NA1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA2,PA1,RO1,VE1,NZ1 from archivio"
End If
If BA1 = PA1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA2,RO1,VE1,NZ1 from archivio"
End If
If BA1 = RO1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO2,VE1,NZ1 from archivio"
End If
If BA1 = VE1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO1,VE2,NZ1 from archivio"
End If
If FI1 = MI1 Then
sSQL = "select ID,Data,BA1,FI1,MI2,NA1,PA1,RO1,VE1,NZ1 from archivio"
End If
If FI1 = NA1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA2,PA1,RO1,VE1,NZ1 from archivio"
End If
If FI1 = PA1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA2,RO1,VE1,NZ1 from archivio"
End If
If FI1 = RO1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO2,VE1,NZ1 from archivio"
End If
If FI1 = VE1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO1,VE2,NZ1 from archivio"
End If
If MI1 = NA1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA2,PA1,RO1,VE1,NZ1 from archivio"
End If
If MI1 = PA1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA2,RO1,VE1,NZ1 from archivio"
End If
If MI1 = RO1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO2,VE1,NZ1 from archivio"
End If
If MI1 = VE1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO1,VE2,NZ1 from archivio"
End If
If NA1 = PA1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA2,RO1,VE1,NZ1 from archivio"
End If
If NA1 = RO1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO2,VE1,NZ1 from archivio"
End If
If NA1 = VE1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO1,VE2,NZ1 from archivio"
End If
If PA1 = RO1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO2,VE1,NZ1 from archivio"
End If
If PA1 = VE1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO1,VE2,NZ1 from archivio"
End If
If RO1 = VE1 Then
sSQL = "select ID,Data,BA1,FI1,MI1,NA1,PA1,RO1,VE2,NZ1 from archivio"
End If

mi aiutate perfavore?