/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
Hjælp !!
Fra : Tyksak


Dato : 10-08-03 17:47

Jeg får denne fejl når jeg køre mit script:

Microsoft VBScript runtime error '800a01a8'
Object required: ''

/nydesign/indexinformation.asp, line 23

Kode i indexinformation.asp:

<%
Dim maxside 'Max antal linier pr. side
Dim antal 'Tæller
Dim len 'Længden på felt
Dim mellemrum 'Spacer melle felter
Dim tom 'En space

maxside = 40
antal = 0
tom = " "

'Initialise the strSQL variable with an SQL statement to query the database
'strSQL = "Select * from Archive"
strSQL = "SELECT tblArchive.Subject, tblArchive.Body_Text, tblArchive.Date
FROM tblArchive;" ' Order by pakke

'Open the recordset with the SQL query
rsinformation.Open strSQL, adoCon

'Loop through the recordset

Do While not rsinformation.EOF

'Write the HTML to display the current record in the recordset
'Response.Write ("<br>")
Response.Write (rsinformation("Date") & " " & rsinformation("Subject"))
Response.Write ("<br>")
Response.Write (rsinformation("Body_Text"))
'Move to the next record in the recordset
rsinformation.MoveNext

Loop

'Reset server objects
rsinformation.Close
Set rsinformation = Nothing
Set adoCon = Nothing


%>


Kode i connect:

<%
Dim adoCon 'Database Connection Variable
Dim rsConfiguration 'Holds the configuartion recordset
Dim strCon 'Holds the Database driver and the path and name of the
database
Dim strSQL 'Holds the SQL query for the database
Dim rsinformation 'Holds the recordset for the records in the database

'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less
connection
'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Server.MapPath("_private/o12mail.mdb") 'This one is for Access 2000/2002

adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("/_private/o12mail.mdb")

'Create an ADO recordset object
Set rsinformation = Server.CreateObject("ADODB.Recordset")

%>


/Gert



 
 
Erik Jørgensen (10-08-2003)
Kommentar
Fra : Erik Jørgensen


Dato : 10-08-03 18:05

Tyksak wrote in dk.edb.internet.webdesign.serverside.asp:
> Jeg får denne fejl når jeg køre mit script:
>
> Microsoft VBScript runtime error '800a01a8'
> Object required: ''
>
Generelt råd: Kopier fejlbeskeden og sæt den ind i Google ... så får du hjælp
... hvis du er heldig at Microsoft har hjælp til emnet.

> /nydesign/indexinformation.asp, line 23
>
> Kode i indexinformation.asp:
>
> <%
&gt; Dim maxside 'Max antal linier pr. side
&gt; Dim antal 'Tæller
Umiddelbart ville jeg tro at fejlen opstår fordi du benytter et reserveret
navn til din variabel "len". Det var bare en hurtig indskydelse

&gt; Dim len 'Længden på felt
&gt; Dim mellemrum 'Spacer melle felter
&gt; Dim tom 'En space
&gt;
&gt; maxside = 40
&gt; antal = 0
&gt; tom = " "
&gt;
&gt; 'Initialise the strSQL variable with an SQL statement to query the
database
&gt; 'strSQL = "Select * from Archive"
&gt; strSQL = "SELECT tblArchive.Subject, tblArchive.Body_Text,
tblArchive.Date
&gt; FROM tblArchive;" ' Order by pakke
&gt;
&gt; 'Open the recordset with the SQL query
&gt; rsinformation.Open strSQL, adoCon
&gt;
&gt; 'Loop through the recordset
&gt;
&gt; Do While not rsinformation.EOF
&gt;
&gt; 'Write the HTML to display the current record in the recordset
&gt; 'Response.Write ("<br>")
&gt; Response.Write (rsinformation("Date") & " " & rsinformation("Subject"))
&gt; Response.Write ("<br>")
&gt; Response.Write (rsinformation("Body_Text"))
&gt; 'Move to the next record in the recordset
&gt; rsinformation.MoveNext
&gt;
&gt; Loop
&gt;
&gt; 'Reset server objects
&gt; rsinformation.Close
&gt; Set rsinformation = Nothing
&gt; Set adoCon = Nothing
&gt;
&gt;
&gt; %>
>
>
> Kode i connect:
>
> <%
&gt; Dim adoCon 'Database Connection Variable
&gt; Dim rsConfiguration 'Holds the configuartion recordset
&gt; Dim strCon 'Holds the Database driver and the path and name of the
&gt; database
&gt; Dim strSQL 'Holds the SQL query for the database
&gt; Dim rsinformation 'Holds the recordset for the records in the database
&gt;
&gt; 'Create an ADO connection odject
&gt; Set adoCon = Server.CreateObject("ADODB.Connection")
&gt;
&gt; 'Set an active connection to the Connection object using a DSN-less
&gt; connection
&gt; 'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
&gt; Server.MapPath("_private/o12mail.mdb") 'This one is for Access 2000/2002
&gt;
&gt; adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
&gt; Server.MapPath("/_private/o12mail.mdb")
&gt;
&gt; 'Create an ADO recordset object
&gt; Set rsinformation = Server.CreateObject("ADODB.Recordset")
&gt;
&gt; %>
>
>
> /Gert
>
>


--
Vil du lære at kode HTML, XHTML, CSS, SSI eller ASP?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! => http://www.html.dk/tutorials

Tyksak (10-08-2003)
Kommentar
Fra : Tyksak


Dato : 10-08-03 18:51

Hej

Jeg fandt slev fejlen. Jeg havde fået includeret den forkerte connect file
til databasen. Er det ikke underligt man kan sidde en hel dag og kigge på et
problem og hvis man går væk fra det et stykke tid kan man pludselig se
fejlen.

/Gert



Torben Brandt (10-08-2003)
Kommentar
Fra : Torben Brandt


Dato : 10-08-03 18:20

Tyksak wrote:
> Jeg får denne fejl når jeg køre mit script:
>
> Microsoft VBScript runtime error '800a01a8'
> Object required: ''
>
> /nydesign/indexinformation.asp, line 23

Det betyder ofte at en variabel før et punktum ikke er sat til noget.
M.a.o. kan man ikke skrive variabel.funktion hvis man ikke har sat
variabel til noget inden.

> Kode i indexinformation.asp:

<snip : en masse kode>

Hvilken linie er linie 23 ?

/Torben


Søg
Reklame
Statistik
Spørgsmål : 177502
Tips : 31968
Nyheder : 719565
Indlæg : 6408532
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste