Line 1: Incorrect syntax near '*'. Ta bort asterisken. Det ska bara vara:Microsoft OLE DB Provider for SQL Server (0x80040E14)
får jag i denna kod..
Det är i Case "Delete" som den inte fungerar som den ska.
Kan inte hitta vad som är fel...
<%
Dim objCommand, objRS, intNoOfRecords
Set objCommand = Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection = strConnect
Select Case ACTION
Case "Add"
objCommand.CommandText = " INSERT INTO tblPersondata (PersonID,Fornamn,Efternamn,MobilNr,PagerNr,Avd,Ort)" &_
" VALUES('" & PersonID & "','" & Fornamn & "','" & Efternamn & "', " &_
"'" & MobilNr & "','" & PagerNr & "','" & Avd & "','" & Ort & "')"
objCommand.CommandType = adCmdText
objCommand.Execute intNoOfRecords
objCommand.CommandText = " INSERT INTO tblSchema (PersonID) VALUES ('" & PersonID & "')"
objCommand.CommandType = adCmdText
objCommand.Execute intNoOfRecords
objCommand.CommandText = "SELECT * FROM tblPersondata " & _
"WHERE PersonID = '" & PersonID & "'"
objCommand.CommandType = adCmdText
Set objRS = objCommand.Execute
Set objCommand = Nothing
Response.Write "<TR><TD> </TD></TR>"
Response.Write "<TR><TD COLSPAN=2><SPAN ID=""text2"">New Data for " & objRS("PersonID") & "</SPAN></TD></TR>"
Response.Write "<TR><TD WIDTH=""25%""><SPAN ID=text3>Förnamn</TD><TD><SPAN ID=text3>" & objRS("Fornamn") & "</SPAN></TD></TR>"
Response.Write "<TR><TD WIDTH=""25%""><SPAN ID=text3>Efternamn</TD><TD><SPAN ID=text3>" & objRS("Efternamn") & "</SPAN></TD></TR>"
Response.Write "<TR><TD WIDTH=""25%""><SPAN ID=text3>MobilNr</TD><TD><SPAN ID=text3>" & objRS("MobilNr") & "</SPAN></TD></TR>"
Response.Write "<TR><TD WIDTH=""25%""><SPAN ID=text3>PagerNr</TD><TD><SPAN ID=text3>" & objRS("PagerNr") & "</SPAN></TD></TR>"
Response.Write "<TR><TD WIDTH=""25%""><SPAN ID=text3>Avd</TD><TD><SPAN ID=text3>" & objRS("Avd") & "</SPAN></TD></TR>"
Response.Write "<TR><TD WIDTH=""25%""><SPAN ID=text3>Ort</TD><TD><SPAN ID=text3>" & objRS("Ort") & "</SPAN></TD></TR>"
Response.Write "<TR><TD COLSPAN=2><p ALIGN=""right""><INPUT TYPE=""button"" NAME=""OK"" VALUE=""OK"" SIZE=8 onClick=""self.location='pers.asp?name=" & name & "&password=" & password & "';"" style=""font-family: Verdana; font-size: 12px; background-color: #e2e2e2; color: #000000""></TD></TR>"
objRS.Close
Set objRS = Nothing
case "Delete"
objCommand.CommandText = " DELETE * FROM tblPersondata " &_
"INNER JOIN tblSchema ON tblSchema.PersonID = tblPersondata.PersonID " & _
"WHERE tblPersondata.PersonID = '" & PersonID & "' "
objCommand.CommandType = adCmdText
objCommand.Execute intNoOfRecords
objRS.Close
Set objRS = Nothing
end select
%>Sv: Microsoft OLE DB Provider for SQL Server (0x80040E14)
DELETE FROM tabell