Får inte communityn att funka. Er community alltså, men förändrade den lite. Här kommer lite av koden Du har ett komma för mycket i ditt VAlue statment. Ta bort det sista argumentet. Communityn
Detta kommer fram:
Feltyp:
Microsoft JET Database Engine (0x80040E14)
Syntaxfel i INSERT INTO-uttryck.
/MFF/comm_reg.asp, line 68
objConn.Execute(strSQL) <- rad 68
-----------------------------------------
Skrev ut SQL satsen (tror jag), genom att skriva:
Response.Write strSQL
Response.End
-----------------------------------------
Då visades detta:
<code>INSERT INTO ALLusers (COMMuser, COMMpass, COMMmail, COMMnamn, COMMalder, COMMtexten, COMMloginstatus, COMMregistrerad)
VALUES ('tr', 'tr', 'fdgd', 'gdfd', '126', 'fgdgd', 0, '2003-02-09 22:08:44', )</code>
//MvhSv: Communityn
<code>
strSQL = ""
strSQL = strSQL & "INSERT INTO ALLusers ("
strSQL = strSQL & "COMMuser, COMMpass, COMMmail, COMMnamn, COMMalder, "
strSQL = strSQL & "COMMtexten, COMMloginstatus, COMMregistrerad"
strSQL = strSQL & ")"
strSQL = strSQL & "VALUES ("
strSQL = strSQL & "'" & strLoginName & "', "
strSQL = strSQL & "'" & strPassword & "', "
strSQL = strSQL & "'" & strEmail & "', "
strSQL = strSQL & "'" & strFullName & "', "
strSQL = strSQL & "'" & strAlder & "', "
strSQL = strSQL & "'" & strPresentation & "', "
strSQL = strSQL & "0, "
strSQL = strSQL & "'" & Now() & "', "
strSQL = strSQL & ")"
</code>Sv: Communityn
Du bör oxå ersätta alla ' med till ''(Två ' tecken). Annars kommer det bli fel om du försöker spara ett värde som innehåller '.
Testa med:
<code>
Function SQLText(Value)
If Len(Value) > 0 Then
SQLText = "'" & Replace(Value, "'", "''") & "'"
Else
SQLText = "Null"
End If
End Function
strSQL = "INSERT INTO ALLusers (COMMuser, " & vbCrLf & _
" COMMpass, " & vbCrLf & _
" COMMmail, " & vbCrLf & _
" COMMnamn, " & vbCrLf & _
" COMMalder, " & vbCrLf & _
" COMMtexten, " & vbCrLf & _
" COMMloginstatus, " & vbCrLf & _
" COMMregistrerad)" & vbCrLf & _
"VALUES (" & SQLText(strLoginName) & ", " & vbCrLf & _
" " & SQLText(strPassword) & ", " & vbCrLf & _
" " & SQLText(strEmail) & ", " & vbCrLf & _
" " & SQLText(strFullName) & ", " & vbCrLf & _
" " & SQLText(strAlder) & ", " & vbCrLf & _
" " & SQLText(strPresentation) & ", " & vbCrLf & _
" 0, " & vbCrLf & _
" " & SQLText(Now()) & ")"
</code>