Sri
|
| Posted: 11/17/2004, 4:33 AM |
|
hi
i am developing a website where upon some values in the record table i need to group them
for example i have a columm (Filiale) where it has two values HH1 and HH2 ( rigth now i have only two values and they can be many more)
Now based on theses values i need to rearrage all the rows in table and show the rows in two girds each having only one value(eitherr HH1 and HH2) and they should also have two different IDs
i have my code for this and but its able to read the values but doesnt do anything i mean it not inserting the values
thanks in advance
Dim conn,conn1
Dim ErrorMessage
Dim SQL
Dim varNewID,rsNewID,Fial,FialID
Dim RecordSet,RecordSetPos
dim Filiale1, Filiale11
dim RowIndex1,UserID1,KundenNummer1,LSNummer1,LSDate1
dim Status1 ,ArtikelNummer1, Herstellernummer1, Bezeichnung11,Bezeichnung21 ,ATKZ1,Menge1
dim RuckgabeMenge1,EKPreis1,Einlagerungsgebuhr1,Lagerort1,Drucken1,Datum1
Set conn = New clsDBConnection1
conn.open
if (event1 <> 0) then
if Last_Identity= 0 then
SQL = "SELECT DISTINCT Filiale FROM OffenPositionen where status= 'N'"
set RecordSet = conn.Execute(SQL)
while not (RecordSet.EOF)
Filiale1 = CCGetValue(RecordSet,"Filiale")
SQL = "INSERT INTO Rueckgabe(KundenNummer,Datum)" &_
"VALUES (" & conn.ToSQL(CCGetUserID(), ccsInteger) & "," & conn.ToSQL(Now(), ccsDate) & ")"
conn.Execute(SQL)
Set rsNewID = conn.Execute("SELECT @@IDENTITY as intIdent")
If Not (rsNewID.EOF) Then
Last_Identity = CInt(CCGetValue(rsNewID,"intIdent"))
'response.write("<br>"&Last_Identity)
else
response.write("<br> The @@IDENTITY Call did not Work!")
response.end()
End IF
SQL = " Select * from OffenPositionen where Filiale='" &Filiale1&"'"
response.write("<br>"&sql)
' Open the recordset
Set RecordSetPos = conn.Execute(SQL)
If NOT RecordSetPos.EOF then
RowIndex1 = CCGetValue(RecordSetPos, "RowIndex")
UserID1 = CCGetValue(RecordSetPos, "UserID")
KundenNummer1 = CCGetValue(RecordSetPos, "KundenNummer")
LSNummer1 = CCGetValue(RecordSetPos, "LSNummer")
'LSDate1 = CCGetValue(RecordSetPos, "LSDate"
Status1 = CCGetValue(RecordSet, "Status")
ArtikelNummer1 = CCGetValue(RecordSetPos, "ArtikelNummer")
Herstellernummer1 = CCGetValue(RecordSetPos, "Herstellernummer")
Bezeichnung11 = CCGetValue(RecordSetPos, "Bezeichnung1")
Bezeichnung21 = CCGetValue(RecordSetPos, "Bezeichnung2")
ATKZ1 = CCGetValue(RecordSetPos, "ATKZ")
'Filiale11 = CCGetValue(RecordSetPos, "Filiale")
Menge1 = CCGetValue(RecordSetPos, "Menge")
RuckgabeMenge1 = CCGetValue(RecordSetPos, "RuckgabeMenge")
EKPreis1 = CCGetValue(RecordSetPos, "EKPreis")
Einlagerungsgebuhr1 = CCGetValue(RecordSetPos, "Einlagerungsgebuhr")
Lagerort1 = CCGetValue(RecordSetPos, "Lagerort")
Datum1 = CCGetValue(RecordSetPos, "Datum")
End if
' Close the recordset
SQL = "INSERT INTO RueckgabePositionen(ReturnID,LSNummer,Filiale)" &_
"VALUES ("& Last_Identity &","&LSNummer1&","&Filiale1&")"
conn.Execute(SQL)
'response.write("<br>"&sql)
RecordSet.MoveNext
Wend
'SQL = "delete FROM OffenPositionen where status= 'N'"
'conn.Execute(SQL)
end if
end if
conn.Close
Set conn = Nothing
' Set RecordSet = Nothing
' Set RecordSetPos = Nothing
on Error Goto 0
|
|
|
 |
|