Bonjour à tous,
Je vien de commencer asp et je ne comprend pas mon erreur qui d'apres moi vient de mes condition if et elseif. Le resultat recu est vide
Merci de maider
mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80 <% dim pc, util pc=request.form("txtFR") util=request.form("txtU") if pc<>"" then set rs=Server.CreateObject("ADODB.Recordset") varSQL = "SELECT computers.computer_name" & _ ",software_name" & _ " FROM computers LEFT JOIN software ON computers.computer_name = software.computer_name" & _ " LEFT JOIN local_users ON computers.computer_name = local_users.computer_name"&_ " WHERE computers.computer_name='" & pc & "'"&_ " AND software.software_name not like 'Correctif%'"&_ " AND software.software_name not like 'Security Update%'"&_ " AND software.software_name not like 'Mise à jour%'"&_ " AND software.software_name not like 'Update for Windows%'"&_ " AND software.software_name not like '%Hotfix %'"&_ " AND software.software_name not like 'Aggiornamento%'"&_ " AND computers.operating_system_name not like '%Server'" & _ "group by computers.computer_name,software.software_name"&_ ";" elseif util<>"" then set rs=Server.CreateObject("ADODB.Recordset") varSQL = "SELECT computers.computer_name" & _ ",software_name" & _ " FROM computers LEFT JOIN software ON computers.computer_name = software.computer_name" & _ " LEFT JOIN local_users ON computers.computer_name = local_users.computer_name"&_ " WHERE local_users.user_name='" & util & "'"&_ " AND software.software_name not like 'Correctif%'"&_ " AND software.software_name not like 'Security Update%'"&_ " AND software.software_name not like 'Mise à jour%'"&_ " AND software.software_name not like 'Update for Windows%'"&_ " AND software.software_name not like '%Hotfix %'"&_ " AND software.software_name not like 'Aggiornamento%'"&_ " AND computers.operating_system_name not like '%Server'" & _ "group by computers.computer_name,software.software_name"&_ ";" elseif pc<>"" and util<>"" then set rs=Server.CreateObject("ADODB.Recordset") varSQL = "SELECT computers.computer_name" & _ ",software_name" & _ " FROM computers LEFT JOIN software ON computers.computer_name = software.computer_name" & _ " LEFT JOIN local_users ON computers.computer_name = local_users.computer_name"&_ " WHERE computers.computer_name='" & pc & "'"&_ " AND local_users.user_name='" & util & "'"&_ " AND software.software_name not like 'Correctif%'"&_ " AND software.software_name not like 'Security Update%'"&_ " AND software.software_name not like 'Mise à jour%'"&_ " AND software.software_name not like 'Update for Windows%'"&_ " AND software.software_name not like '%Hotfix %'"&_ " AND software.software_name not like 'Aggiornamento%'"&_ " AND computers.operating_system_name not like '%Server'" & _ "group by computers.computer_name,software.software_name"&_ ";" rs.open varSQL, "Provider=SQLOLEDB.1;Password=sqlinfo;Persist Security Info=True;User ID=info;Initial Catalog=york_tn;Data Source=FRCARFS13" response.write "<table border bordercolor=#000000 cellpadding=2>" response.write"<tr>" response.write"<th>Nom du PC</th>" response.write"<th>Logiciel</th>" response.write"</tr>" do while not rs.eof response.write "<tr align=center>" response.write "<td>" response.write rs("computer_name") response.write"</td>" response.write "<td>" response.write rs("software_name") response.write"</td>" response.write "</tr>" rs.MoveNext loop response.write "</table>" rs.close end if %>
Partager