Hoi,
Ik ben een ASP newbie en ik vind het nog niet prettig werken, maar goed.
Het onderstaande script:
Op regel 117 wil ik insQry steeds een nieuwe waarde geven.
Maar hij blijft maar de oude waarde teruggeven uit regel 73!?
Hoe kan dit nou toch!? Ik zie vast iets over het hoofd, maar goed ...
HELP!
Ik ben een ASP newbie en ik vind het nog niet prettig werken, maar goed.
Het onderstaande script:
code:
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
| <%@ Language=VBScript %>
<%Option Explicit%>
<!-- #include file="upload.asp" -->
<%
on error resume next
Response.Buffer=True
'NOTE - YOU MUST HAVE VBSCRIPT v5.0 INSTALLED ON YOUR WEB SERVER
' FOR THIS LIBRARY TO FUNCTION CORRECTLY. YOU CAN OBTAIN IT
' FREE FROM MICROSOFT WHEN YOU INSTALL INTERNET EXPLORER 5.0
' OR LATER.
' Create the FileUploader
Dim Uploader, File, savePath
savePath = "E:\Port Folio\Freelance opdrachten\printermanager\uploads\"
Set Uploader = New FileUploader
Uploader.Upload()
dim conn, insQry, updQry, delQry, insResult, selPattern, Icc, Linear, i
Icc = ""
Linear = ""
'Open ODBC connection
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "printermanager"
'******************************************
' Use [FileUploader object].Form to access
' additional form variables submitted with
' the file upload(s). (used below)
'******************************************
if Uploader.Form("btnAddBase")="add colorbase" then
' Next step: add new DotPattern if needed
if Uploader.Form("newpattern")<>"" and Uploader.Form("newpattern")<>"enter new dot pattern here" then
insQry = "INSERT INTO `tblDotpatterns`" &_
"(`txtPa_Description`) VALUES " &_
"('" & Uploader.Form("newpattern") & "')"
conn.Execute(insQry)
set insResult = conn.Execute("SELECT @@IDENTITY")
selPattern = insResult(0)
insResult.Close()
if err<>0 then
Response.Write("Could not insert new dot pattern!<br />")
selPattern = 1
end if
elseif Uploader.Form("dotpattern")<>"" then
selPattern = Uploader.Form("dotpattern")
else
selPattern = 1
end if
'Next step: handle file uploads
'iccprofile and linearfile
if Uploader.Files.Count = 0 then
Icc = ""
Linear = ""
else
if Uploader.Files("iccprofile").FileName<>"" then
Icc = Uploader.Files("iccprofile").FileName
Uploader.Files("iccprofile").SaveToDisk savePath
else
Icc = ""
end if
if Uploader.Files("linearfile").FileName<>"" then
Linear = Uploader.Files("linearfile").FileName
Uploader.Files("linearfile").SaveToDisk savePath
else
Linear = ""
end if
end if
'Insert new ColorBase
insQry = "INSERT INTO `tblColorbase`" &_
"(`txtCB_Title`, " &_
" `lngCB_StatusID`, " &_
" `lngCB_MediaManufacturerID`, " &_
" `lngCB_MediaPrintID`, " &_
" `lngCB_CombiPrinterID`, " &_
" `lngCB_InkManufacturerID`, " &_
" `lngCB_InkID`, " &_
" `lngCB_DotpatternID`, " &_
" `txtCB_Qualitymode`, " &_
" `lngCB_DensityC`, " &_
" `lngCB_DensityM`, " &_
" `lngCB_DensityY`, " &_
" `lngCB_DensityK`, " &_
" `txtCB_IccProfile`, " &_
" `txtCB_Linear`, " &_
" `txtCB_Remarks`)" &_
" VALUES " &_
"('" & Uploader.Form("title") & "', " &_
" '" & Uploader.Form("status") & "', " &_
" '" & Uploader.Form("mediamanufacturer") & "', " &_
" '" & Uploader.Form("media") & "', " &_
" '" & Uploader.Form("combi") & "', " &_
" '" & Uploader.Form("inkmanufacturer") & "', " &_
" '" & Uploader.Form("ink") & "', " &_
" '" & selPattern & "', " &_
" '" & Uploader.Form("qmode") & "', " &_
" '" & Uploader.Form("densC_part1") & "', " &_
" '" & Uploader.Form("densM_part1") & "', " &_
" '" & Uploader.Form("densY_part1") & "', " &_
" '" & Uploader.Form("densK_part1") & "', " &_
" '" & Icc & "', " &_
" '" & Linear & "', " &_
" '" & Uploader.Form("remarks") & "') "
conn.Execute(insQry)
if err<>0 then
Response.Write("Could not insert new colorbase!<br />")
Response.Write("<br />" & insQry)
else
set insResult = conn.Execute("SELECT @@IDENTITY")
cbID = insResult(0)
insResult.Close()
' Add temperatures
for i=0 to cInt(Uploader.Form("numHeaters"))-1
insQry = "INSERT INTO `tblHeaterTemps` ( " &_
" `lngHT_ColorbaseID`, " &_
" `lngHT_HPHeaterID`, " &_
" `lngHT_Temperature` " &_
") VALUES ( " &_
" '" & cbID & "', " &_
" '" & Uploader.Form("heaterID[" & i & "]") & "', " &_
" '" & Uploader.Form("heaterTemp[" & i & "]") & "' " &_
")"
Response.Write insQry & "<br />"
conn.Execute(insQry)
next
end if
end if
' Close connection
conn.Close
%> |
Op regel 117 wil ik insQry steeds een nieuwe waarde geven.
Maar hij blijft maar de oude waarde teruggeven uit regel 73!?
Hoe kan dit nou toch!? Ik zie vast iets over het hoofd, maar goed ...
HELP!