On 21 Maj, 13:12, "Claus Skaarup \(Arbejde\)"
<c...@limfjordsteatret.fejl> wrote:
> Hvorfor får jeg fejlen i subj? Jeg forsøger bare at udskrive indholdet i en
> tabel. Her er koden:
>
> Set Conn = Server.CreateObject("ADODB.Connection")
> DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
> DSN = DSN & "DBQ=" & Server.MapPath("../db/Sommerskole.mdb")
> Conn.Open DSN
>
> sommersko = "SELECT * FROM Sommer07"
> set sskole = Conn.Execute(sommmersko)
>
> do while not sskole.EOF
> response.write "<td>" & sskole("Navn") & "</td><td>" & sskole("Klasse") &
> "</td><td>" & sskole("Vente") & "</td></tr>"
> sskole.MoveNext
> Loop
Jeg har fundet nedestående som måske kan hjælpe lidt på vej.
Prøv at indsætte <%option explicit %> øverst i dit dokument SOM LINIE
1, det giver sikkert en anden fejlmeddelelse som er nemmere at hjælpe
ud fra
se også denne artikel:
http://www.asp-faq.dk/article/?id=41
----------------
http://66.102.9.104/search?q=cache:aGnjwQ6uYCEJ:tutorials.aspfaq.com/8000xxxxx-errors/why-do-i-get-80040e0c-errors.html+asp+%22Command+text+was+not+set+for+the+command+object%22&hl=da&ct=clnk&cd=16
Microsoft OLE DB Provider for ODBC Drivers error '80040e0c'
Command text was not set for the command object.
This error is usually caused by an empty SQL statement (and does not
necessarily deal with the explicit ADODB.Command object). Here is a
sample piece of code that will cause this error:
<%
set conn = CreateObject("ADODB.Connection")
conn.open "<connection string>"
' notice the flip flop of strSQL -> SQLstr
strSQL = "UPDATE table SET dt = CURRENT_TIMESTAMP"
conn.execute(SQLstr)
' ...
%>
Using Option Explicit would prevent errors like this from happening
(well, actually, using Option Explicit would just cause a different
error). Using quick and sensible debugging practices will help
determine the cause of many SQL-related errors.
--------------------
PS: Din fejl er ------> for mange "m" i set sskole =
Conn.Execute(sommmersko)
Chr.