% ' Declaring variables Dim message, data_source, con, sql_insert ' A Function to check if some field entered by user is empty Function ChkString(string) If string = "" Then string = " " ChkString = Replace(string, "'", "''") End Function ' Receiving values from Form editid = ChkString(Request.Form("MessageID")) nick = ChkString(Request.Form("nick")) navn = ChkString(Request.Form("navn")) alder = ChkString(Request.Form("alder")) klasse = ChkString(Request.Form("klasse")) motto = ChkString(Request.Form("motto")) hardware = ChkString(Request.Form("hardware")) i16c = ChkString(Request.Form("i16c")) u16c = ChkString(Request.Form("u16c")) pjat = ChkString(Request.Form("pjat")) lillebillede = ChkString(Request.Form("lillebillede")) stortbillede = ChkString(Request.Form("stortbillede")) aktiv = ChkString(Request.Form("aktiv")) steamid = ChkString(Request.Form("steamid")) data_source = "DRIVER={MySQL}; Server=mydb6.surf-town.net; Database=spoforum; Uid=spoaddi_php; Password=smovs;" sql_insert = "UPDATE 16cplayers SET nick = '" & nick & "', navn = '" & navn & "', alder = '" & alder & "', klasse = '" & klasse & "', motto = '" & motto & "', hardware = '" & hardware & "', i16c = '" & i16c & "', u16c = '" & u16c & "', pjat = '" & pjat & "', lillebillede = '" & lillebillede & "', stortbillede = '" & stortbillede & "', aktiv = '" & aktiv & "', steamid = '" & steamid & "' WHERE id = '" & editid &"' " ' Creating Connection Object and opening the database Set con = Server.CreateObject("ADODB.Connection") con.Open data_source con.Execute sql_insert ' Done. Close the connection con.Close Set con = Nothing %>