Home directory for Malawi's wwwroot
Duncan Ewan
2021-02-19 3e758c29e0fde36fc088efcfc88f9a3014432b64
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
<cftry>
    <cfif IsDefined("opCode")>
        <cfif IsDefined("Driver")>
          <cfif (#FindNoCase(#Driver#,"SQL Server")# NEQ 0)>
                <cfinclude TEMPLATE="SQLServer7.cfm">
          <cfelse>
                <cfscript>
                    xmlOutput = "";
                    xmlOutput = xmlOutput & "<ERRORS>";
                    xmlOutput = xmlOutput & "<ERROR";
                    xmlOutput = xmlOutput & " Description=""";
                    xmlOutput = xmlOutput & "Stored Procedures For " & #Driver# & " are not supported";
                    xmlOutput = xmlOutput & """";
                    xmlOutput = xmlOutput & " Identification=""";
                    xmlOutput = xmlOutput & "";
                    xmlOutput = xmlOutput & """";
                    xmlOutput = xmlOutput & "></ERROR>";
                    xmlOutput = xmlOutput & "</ERRORS>";
                </cfscript>
                <cfoutput>#xmlOutput#</cfoutput>
          </cfif>
        </cfif>
    </cfif>
    <cfif IsDefined("opCode") AND IsDefined("ResultSet")>
        <cfscript>
            xmlOutput = "";
            xmlOutput = xmlOutput & "<RESULTSET>";
            xmlOutput = xmlOutput & "<FIELDS>";
            MM_columns = ListToArray(ResultSet.ColumnList,",");
            For (i=1; i LTE ArrayLen(MM_columns); i=i+1) 
            {
                xmlOutput = xmlOutput & "<FIELD";
                xmlOutput = xmlOutput & " name=""";
                xmlOutput = xmlOutput & MM_columns[i];
                xmlOutput = xmlOutput & """";
                xmlOutput = xmlOutput & "></FIELD>";
            }
            xmlOutput = xmlOutput & "</FIELDS>";
            xmlOutput = xmlOutput & "<ROWS>";
            For (i=1; i LTE ResultSet.RecordCount ; i=i+1) 
            {
                xmlOutput = xmlOutput & "<ROW";
                For (j=1; j LTE ArrayLen(MM_columns); j=j+1) 
                {
                    xmlOutput = xmlOutput & " " & MM_columns[j] & "=""";
                    if (#FindNoCase(#Driver#,"SQL Server")# NEQ 0)
                    {
                        if (MM_columns[j] EQ "PARAMETER_TYPE")
                        {
                            if (ResultSet[MM_columns[j]][i] EQ "1")
                            {
                                xmlOutput = xmlOutput & "2";
                            }
                            else if (ResultSet[MM_columns[j]][i] EQ "0")
                            {
                                xmlOutput = xmlOutput & "1";
                            }
                            else
                            {
                                xmlOutput = xmlOutput & ResultSet[MM_columns[j]][i];
                            }
                        }
                        else
                        {
                                xmlOutput = xmlOutput & ResultSet[MM_columns[j]][i];
                        }
                    }
                    else
                    {
                        xmlOutput = xmlOutput & ResultSet[MM_columns[j]][i];
                    }
                    xmlOutput = xmlOutput & """";
                }
                xmlOutput = xmlOutput & "></ROW>";
            }
            xmlOutput = xmlOutput & "</ROWS>";
            xmlOutput = xmlOutput & "</RESULTSET>";
        </cfscript>
        <cfoutput>#xmlOutput#</cfoutput>
    </cfif>
<cfcatch type="Database">
<cfscript>
    xmlOutput = "";
    xmlOutput = xmlOutput & "<ERRORS>";
    xmlOutput = xmlOutput & "<ERROR";
    xmlOutput = xmlOutput & " Description=""";
    xmlOutput = xmlOutput & cfcatch.message;
    xmlOutput = xmlOutput & """";
    xmlOutput = xmlOutput & " Identification=""";
    xmlOutput = xmlOutput & cfcatch.NativeErrorCode;
    xmlOutput = xmlOutput & """";
    xmlOutput = xmlOutput & "></ERROR>";
    xmlOutput = xmlOutput & "</ERRORS>";
</cfscript>
    <cfoutput>#xmlOutput#</cfoutput>
</cfcatch>
</cftry>