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:
>
> <%
> Dim maxside 'Max antal linier pr. side
> 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
> 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
>
>
--
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