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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
| <%
select case valeur
case 1
......
case 2
' SERVEUR QUI HÉBERGE LA BASE DE DONNÉES
' ======================================
Actuel = serveur de Strasbourg
strDSN = "HOST=....;DSN=SDWB;"
if bDebug then Response.Write "<br>strDSN : " & strDSN end if
' ALIM DE VARIABLES : à alimenter avec lec critères saisis par l'utilisateur !
' =================
typeInclude= Request.QueryString("listtype")
site= Request.QueryString("listsite")
espace= Request.QueryString("listespace")
dateDeb= Request.QueryString("txtdatedeb")
dateFin= Request.QueryString("txtdatefin")
' CREATION OBJET PERMETTANT L'ACCÈS À LA BDD
' ==========================================
Set oMOM = Server.CreateObject("Midw_client.DynamicMom.1")
oMOM.SetConnectionType 0,strDSN
Set oSQLRech = Server.CreateObject("Midw_client.DynamicMomSQL.1")
' FICHIER .ini QUI CONTIENT LES REQUÊTES SQL
' ==========================================
FichierIni = "ADMINPDF"
' PASSAGE DE PARAMÈTRES À LA REQUÊTE SQL
' ======================================
if typeInclude="" and site="" and espace="" and dateDeb="" and dateFin="" then
ReqSQL="SELECTALL" 'reqSQL="SELECTALL" 'SELECT * FROM AdminPDF
' LANCEMENT DE LA REQUÊTE SQL
oSQLRech.AddRequest ReqSQL, FichierIni
end if
if typeInclude<>"" then
ReqSQL="SELECTTYPE" 'SELECT * FROM AdminPDF WHERE typeInclude='$typeInclude$'
oSQLRech.AddRequest ReqSQL, FichierIni
strtype = typeInclude
oSQLRech.Setparam "typeInclude", strtype
end if
if site<>"" then
ReqSQL="SELECTSITE" 'SELECT * FROM AdminPDF WHERE site='$site$'
oSQLRech.AddRequest ReqSQL, FichierIni
strsite = site
oSQLRech.Setparam "site", strsite
end if
if espace<>"" then
ReqSQL="SELECTESPACE" 'SELECT * FROM AdminPDF WHERE espace='$espace$'
oSQLRech.AddRequest ReqSQL, FichierIni
strespace = espace
oSQLRech.Setparam "espace", strespace
end if
if dateDeb<>"" and dateFin<>"" then
ReqSQL="SELECTDATES" 'SELECT * FROM AdminPDF WHERE dateDeb>='$dateDeb$' AND dateFin<='$dateFin$'
oSQLRech.AddRequest ReqSQL, FichierIni
strdated = dateDeb
strdatef = dateFin
oSQLRech.Setparam "dateDeb", strdated
oSQLRech.Setparam "dateFin", strdatef
end if
if bDebug then
Response.Write "<br>ReqSQL : " & ReqSQL
Response.Write "<br>FichierIni : " & FichierIni
end if
' EXÉCUTION DE LA REQUETE SQL
oSQLRech.DynamicLtnv = oMOM.Execute( oSQLRech.DynamicLtnv,20000)
' RÉSULTAT DE LA REQUETE SQL
if bDebug then
Response.Write "<br>err.number : " & err.number
Response.Write "<br>err.Description : " & err.Description
end if
if err.number <> 0 then
set oSQLRech = nothing
Response.End
end if
' EXPLOITATION DES DONNÉES RÉCUPÉRÉES
nbRows = oSQLRech.ReturnedRows
if bDebug then Response.Write "<br>nbRows : " & nbRows end if
case 3
.....
end select
%> |
Partager