title image


Smiley Fehler undefiniert
Hallo liebe forum-anwender!

Brauche hilfestellung oder erklärung warum dieser code nicht funktioniert.

Die Fehlermeldung lautet: Zeile 62 'kst' undefiniert!

Danke im voraus....





















function Click1(kst,koaa)

{ document.navigation.action= "?Anlegen=1";

document.navigation.submit()

}



function Click2(kst,koaa)

{ document.navigation.action= "comment.asp?Loeschen=1&kst="+kst+"&koaa="+koaa;

document.navigation.submit()

}

//document.form1.action

//document.form1.submit()

//+document.form1.select1.value

function Click3(kst,koaa)

{ document.navigation.action= "comment.asp?Aendern=1&kst="+kst+"&koaa="+koaa;

document.navigation.submit()

}

------------------------------------------------------------------------------

!!!! HIER ÜBERGEBE ICH DIE VARIABLEN AN MEIN CLICK-EREIGNISS!!!!!!!!!!!!!!

function Click4(kst,koaa)

{ document.navigation.action= "comment.asp?Selected=1&kst="+kst+"&koaa="+koaa;

document.navigation.submit()

}

-----------------------------------------------------------------------------------

function Click5(kst,koaa)

{ document.navigation.action= "comment.asp?Selected=1&kst="+kst+"&koaa="+koaa;

document.navigation.submit()

}





<%

dim objConnSQL

dim strConn

dim objCmd

dim objRS

dim sSQL

dim Nodex

dim skst

dim skoaa



Set objConnSQL = Server.CreateObject("ADODB.Connection")

objConnSQL.Provider = "sqloledb"



set oNet = CreateObject("WScript.Network")

strConn = "Persist Security Info=False;"

strConn = strConn & "User ID=testuser;"

strConn = strConn & "Password=testuser;"

strConn = strConn & "Initial Catalog=IstPlan;"

strConn = strConn & "Data Source="+oNet.ComputerName

objConnSQL.Open strConn

set objCmd = Server.CreateObject("ADODB.Command")

Set objCmd.ActiveConnection = objConnSQL

set objRS = Server.CreateObject("ADODB.Recordset")

objCmd.CommandType = &H0001

set oNet = nothing

set objFSO = CreateObject("Scripting.FileSystemObject")

set DebugFile = objFSO.CreateTextFile(Server.MapPath("SaveComment.txt"),true)



sAnlegen = Request.QueryString("Anlegen")

sLoeschen = Request.QueryString("Loeschen")

sAendern = Request.QueryString("Aendern")

sSelected = Request.QueryString("Selected")



skst = Request.QueryString("kst")

skoaa = Request.QueryString("koaa")



Kommentar_text1 = Request.form("text1")



DebugFile.WriteLine("kst: " +kst)

DebugFile.WriteLine("koaa: " +koaa)

DebugFile.WriteLine("skst: " +skst)

DebugFile.WriteLine("skoaa: " +skoaa)



Kommentar_text1 = Replace(Kommentar_text1, "'", "''")



if skst "" and skoaa "" then

objCmd.CommandText = "select disp from dim_kostenstelle_pc " & _

" where ident = " +skst

DebugFile.WriteLine("dim_kostenstelle_pc: " +objCmd.CommandText)

set objRS = objCmd.Execute

sKostenstelle = objRS.Fields(0)

DebugFile.WriteLine("sKostenstelle: " +sKostenstelle)





objCmd.CommandText = "select disp from dim_kostenart_pc " & _

" where ident = " +skoaa

DebugFile.WriteLine("dim_kostenart_pc: " +objCmd.CommandText)

set objRS = objCmd.Execute

sKostenart = objRS.Fields(0)

DebugFile.WriteLine("sKostenart: " +sKostenart)



%>







Kommentierung zur Abweichungsanalyse 2005





Kostenstelle:







Kostenart:

 

 









<%



end if





AnlegenText = 0

if sAnlegen "" and skst "" and skoaa "" then



objCmd.CommandText = "insert into kommentar values (" & _

skst+"," & _

skoaa+"," & _

"'"+Replace(sComment, "'", "''")+"', '" &_

CStr(date()) + "')"

DebugFile.WriteLine("Anlegen: " +objCmd.CommandText)

objCmd.Execute

AnlegenText = 1

end if



AendernText = 0

if sAendern "" and skst "" and skoaa "" then



objCmd.CommandText = " update Kommentar " &_

" set Kommentar = '" & Kommentar_text1 & "' " &_

"where kstident = " +skst & _

" and koartident = " +skoaa



DebugFile.WriteLine("Ändern: " +objCmd.CommandText)

objCmd.Execute

AendernText = 1

end if



LoeschenText = 0

if sLoeschen "" and skst "" and skoaa "" then



objCmd.CommandText = "delete from kommentar " & _

"where kstident = " +skst & _

" and koartident = " +skoaa



DebugFile.WriteLine("Löschen: " +objCmd.CommandText)

objCmd.Execute

LoeschenText = 1

end if



%>







------------------------------------------------------------------------------

!!!!!!!!!!!!!!!HIER SOLLTE MEIN CLICK EREIGNISS AUSGEFÜHRT WERDEN!!!!!!!

Kommentar:



<%

objCmd.CommandText = "select id,kommentar, erfassdatum from Kommentar " &_

" where kstident = " +skst & _

" and koartident = " +skoaa &_

" order by erfassdatum"



!!!!!!!!!!!!!! ABER ES KLAPPT NICHT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

---------------------------------------------------------------------------

DebugFile.WriteLine("Kommentar: " +objCmd.CommandText)

set objRS = objCmd.Execute

do while not objRS.EOF

sid = objRS.Fields(0)

skommentar = objRS.Fields(1)

serfassdatum= objRS.Fields(2)





if sSelected = cstr(sid)then



%>

" Selected >



<%

else

%>

" >



<%

end if

objRS.MoveNext

loop

objRS.Close

%>





Erfassdatum:





<%



objCmd.CommandText = "select id,kommentar, erfassdatum from Kommentar" &_

" where kstident = " +skst & _

" and koartident = " +skoaa

DebugFile.WriteLine("Erfassdatum: " +objCmd.CommandText)

set objRS = objCmd.Execute



do while not objRS.EOF

sid = objRS.Fields(0)

skommentar = objRS.Fields(1)

serfassdatum= objRS.Fields(2)



if sSelected = cstr(sid) then



%>

" Selected >



<%

else

%>

" >



<%

end if

objRS.MoveNext

loop

objRS.Close







if sSelected "" and skst "" and skoaa "" then

objCmd.CommandText = "select id, Kommentar, Erfassdatum from Kommentar " &_

"where id = " & sSelected

set objRS = objCmd.Execute

tmpid = CStr(objRS.Fields(0))

tmpKommentar = CStr(objRS.Fields(1))

tmpErfassdatum = CStr(objRS.Fields(2))

objRS.MoveNext

objRS.Close



end if



%>













 

 











Kommentar erfassen:





" type="text" id=text1 name="text1" size=60 rows=10 align=left>































 











<%

if AnlegenText = 1 then

%>

 





Kommetar wurde gespeichert!





<%

end if

%>



<%

if AendernText = 1 then

%>

 





Kommentar wurde geändert !





<%

end if

%>



<%

if LoeschenText = 1 then

%>

 





Kommentar wurde gelöscht !





<%

end if



set objRS = nothing

set objCmd = nothing

set objSQL = nothing

objConnSQL.Close

set objConnSQL = nothing

set strconn = nothing

%>







geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: