1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
public sub trouveDansTable (machaine)
dim tables(3) 'liste des tables
dim icpt 'index de la société en cours d'analyse
dim cnx 'connexion à la bas
dim ligne 'ligne en cours dans la base
dim champ 'parcours de tous les champs de la base
tables (0) = "societes"
tables (1) = "clients"
tables (2) = "commandes"
set cnx = server.createobject("adodb.connection")
Set cnx = Server.CreateObject("ADODB.Connection")
cnx.Mode = 3 '3 = adModeReadWrite
cnx.Provider = "Microsoft.Jet.Oledb.4.0"
cnx.Open Server.Mappath("\") & "\databases\mabase.mdb"
set rs = server.create object("adodb.recordset")
with rs
for icpt = 0 to ubound(tables)
.open table icpt,cnx,0,1
do until .eof
for each champ in .fields
if champ.value = machaine then
response.write machaine & "trouvé dans la table" & table(icpt) & " à la ligne " & ligne
end if
next
.movenext
ligne = ligne + 1
loop
.close
next
end with
set rs = nothing
cnx.close
set cnx = nothing
end function |
Partager