Vad får du för fel?
Jag ser inget anrop till rs.addnew i koden.
Är kat en tabell? I så fall skall du ange adCmdTable som (5:e) parameter till open.
------------------
essentitia preter non sans multiplicandum
6 svar · 185 visningar · startad av His Divine Shadow
Rabrytnings scriptet har lsutat funka för mig, fattar inte varför...
Här är nu scriptet:
<%
'Declare all local variables
dim conn
dim rs
dim strID
dim strconn
'set a local variable to my DSN-less connection String
strconn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\data\WebData\katalog.mdb"
'Create the Connection object
set conn = server.createobject("adodb.connection")
conn.open strconn
'Create the recordset object
set rs = server.createobject("adodb.recordset")
'This statement opens the table so we can add a record notice the addnew
'The 2, 2 is how the table is opened there are many ways it can be opened
rs.open "Kat", conn, 2, 2
Function bryt(txt)
If IsEmpty(txt) OR IsNull(txt) Then Exit Function
txt = Server.HTMLEncode(txt)
txt = Replace(Trim(txt), vbCrLf, "<br>")
bryt = txt
End Function
rs("ovrigt_swe") = bryt("Ovrigt_swe")
rs("ovrigt_fin") = bryt("Ovrigt_fin")
'Use the addnew method of the recordset object to add a record
rs.update
'Set the table column = to my input text box from my form
rs("Namn") = request.Form("Namn")
rs("Naradress") = request.Form("Naradress")
rs("Postnr") = request.Form("Postnr")
rs("Ort") = request.Form("Ort")
rs("Tel") = request.Form("Tel")
rs("Fax") = request.Form("Fax")
rs("Epost") = request.Form("Epost")
rs("www") = request.Form("www")
rs("Amnesomrade") = request.Form("Amnesomrade")
rs("Ovrigt_swe") = request.Form("Ovrigt_swe")
rs("Ovrigt_fin") = request.Form("Ovrigt_fin")
rs("Password") = request.Form("Password")
rs.update
'I do a movelast here to get the ID that is automatically generated
'I also set the value to a local variable so I can write out to the database
rs.movelast
strID = rs("ID")
%>
<%
'Always! Always set your objects to nothing. This clears them out of servers memory
'Your network admins will like this
set rs= nothing
set conn = nothing
Response.Redirect "Focus.asp?ID=ID"
%>
------------------
His Divine Shadow is the most despicable being ever created.
If you were to gather together all the nastiest words in all the countries of the world, squash them together to make three words, they would come out as His Divine Shadow.<br>
http://forums.planetdivine-shadow.com
Vad får du för fel?
Jag ser inget anrop till rs.addnew i koden.
Är kat en tabell? I så fall skall du ange adCmdTable som (5:e) parameter till open.
------------------
essentitia preter non sans multiplicandum
"Vad får du för fel?"
Inget fel, bara ingen radbrytning.
"Jag ser inget anrop till rs.addnew i koden."
Det borde väl inte finnas då detta script uppdaterar redan tillagda poster.
"Är kat en tabell? I så fall skall du ange adCmdTable som (5:e) parameter till open."
Prövar.
Nej ingen radbrytning
------------------
His Divine Shadow is the most despicable being ever created.
If you were to gather together all the nastiest words in all the countries of the world, squash them together to make three words, they would come out as His Divine Shadow.<br>
http://forums.planetdivine-shadow.com
Ja jag tror det :)
Texten hämtas från ett formulär och dom fälten är av typen textarea i formuläret
------------------
His Divine Shadow is the most despicable being ever created.
If you were to gather together all the nastiest words in all the countries of the world, squash them together to make three words, they would come out as His Divine Shadow.<br>
http://forums.planetdivine-shadow.com
No luck, ingen radbrytning...
------------------
His Divine Shadow is the most despicable being ever created.
If you were to gather together all the nastiest words in all the countries of the world, squash them together to make three words, they would come out as His Divine Shadow.<br>
http://forums.planetdivine-shadow.com