Hi all.
I have problem with this asp code: - strSplitDati = Split(request.Form("dati"), ",")
-
-
for i = LBound(strSplitDati) to (INT(UBound(strSplitDati)/4)-1)*4 step 4
-
-
-
strSql = " INSERT INTO "
-
strSql = strSql & " tbl "
-
strSql = strSql & " ( "
-
strSql = strSql & " ID_UEV, "
-
strSql = strSql & " UEV, "
-
strSql = strSql & " testo_A, "
-
strSql = strSql & " testo_B, "
-
strSql = strSql & " numero_A, "
-
strSql = strSql & " numero_B "
-
strSql = strSql & " ) "
-
strSql = strSql & " VALUES "
-
strSql = strSql & " ( "
-
strSql = strSql & " " & replace(strUEV(0), "'", "''") & ", "
-
strSql = strSql & " '" & replace(strUEV(1), "'", "''") & "', "
-
-
-
if Trim(strSplitDati(i) & "[]") <> "[]" AND Trim(strSplitDati(i+1) & "[]") <> "[]" AND _
-
Trim(strSplitDati(i+2) & "[]") <> "[]" AND Trim(strSplitDati(i+3) & "[]") <> "[]" _
-
then
-
strSql = strSql & ",'" & strSplitDati(i) & "' "
-
strSql = strSql & ",'" & strSplitDati(i+1) & "' "
-
strSql = strSql & "," & strSplitDati(i+2) & " "
-
strSql = strSql & "," & strSplitDati(i+3) & " "
-
-
else
-
-
strSql = strSql & ", '-' "
-
strSql = strSql & ", '-' "
-
strSql = strSql & ", -1 "
-
strSql = strSql & ", -1 "
-
-
end if
-
-
strSql = strSql & " ) "
-
cn.execute strSql
-
-
response.write strSQL & "<br /><br />"
-
-
next
this code write this : Quote:
INSERT INTO tbl ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', '-' , '-' , -1 , -1 )
INSERT INTO tbl ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', '-' , '-' , -1 , -1 )
INSERT INTO tbl ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', '-' , '-' , -1 , -1 )
INSERT INTO tbl ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', '-' , '-' , -1 , -1 )
INSERT INTO tbl ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', '-' , '-' , -1 , -1 )
INSERT INTO tbl ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', 'CS7' ,'Ins' ,1 ,2 )
INSERT INTO tbl ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', 'CS8' ,'Suf' ,3 ,4 )
and not this: why ???? Quote:
INSERT INTO tbly ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', '-' , '-' , -1 , -1 )
INSERT INTO tbly ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', 'CS7' ,'Ins' ,1 ,2 )
INSERT INTO tbly ( ID_UEV, UEV, testo_A, testo_B, numero_A, numero_B ) VALUES ( 1, 'TRLM', 'CS8' ,'Suf' ,3 ,4 )
|