Variabeln lngRA innehåller antalet poster som uppdaterades när du har kört dina SQL-frågor (när du har med den i execute-anropet).
Du får skapa ett par variabler i asp som du räknar med, typ:
[b]lUpdates = 0[/b]
[b]lInserts = 0[/b]
.......
'Uppdatera tblArticle om artikeln redan finns
sSQL = "UPDATE tblArticle SET articleNumber = '" & sEnumber & "', articleName = '" & sArticleName & "', articleUnit = '" & sUnit & "' WHERE articleNumber = '" & sEnumber & "'"
objConn.Execute sSQL, lngRA, 128
[b]lUpdates = lUpdates + lngRA[/b]
if lngRa = 0 then
'Lägga till artikeln i tblArticle om den inte finns
sSQL = "INSERT INTO tblArticle (articleNumber, articleName, articleUnit) VALUES ('" & sEnumber & "', '" & sArticleName & "', '" & sUnit & "')"
objConn.Execute sSQL,,128
[b]lInserts = lInserts + 1[/b]
End if
'Uppdatera tblPrice om artikeln redan finns
sSQL = "UPDATE tblPrice SET articleNumber = '" & sEnumber & "', articleSupplierId = " & iSupplierId & ", articlePrice = " & iPrice & ", " &_
"articleCategoryNumber = '" & sCategory & "' WHERE articleNumber = '" & sEnumber & "' AND articleSupplierId = " & iSupplierId
objConn.Execute sSQL, lngRA, 128
[b]lUpdates = lUpdates + lngRA[/b]
if lngRA = 0 then
'Lägga till artikeln i tblPrice om den inte finns
sSQL = "INSERT INTO tblPrice (articleNumber, articleSupplierId, articlePrice, articleCategoryNumber) " &_
"VALUES ('" & sEnumber & "', " & iSupplierId & ", " & iPrice & ", '" & sCategory & "')"
objConn.Execute sSQL,, 128
[b]lInserts = lInserts + 1[/b]
End If
Jag passar också på att flytta tråden från SQL.
mvh

