Visualizzazione dei risultati da 1 a 8 su 8
  1. #1

    problema connessione database

    Devo fare stampare a video i record di un db di nome parco_auto.
    Quando apro la pagina però mi da quest'errore:
    Tipo di errore:

    Errore di run-time di Microsoft VBScript (0x800A01A8)
    Necessario oggetto: ''
    /corso_asp/alcars/offerta.asp, line 37

    Perfavore datemi una mano a farlo funzionare. Grazie


    <%
    set dbconn = server.createobject("adodb.connection")
    dbconn.open(application("strconn"))
    set rstcategorie = server.createobject("adodb.recordset")
    dim sql
    SQL = "SELECT * FROM parco_auto"
    set rstCategorie = ObjConn.Execute(SQL)

    if not rstCategorie.EOF then
    response.write "<TABLE BORDER=0><tr>"
    For i=0 to rstCategorie.Fields.Count-1
    response.write "<td>" & rstCategorie.fields(i).Name & "</td>"
    Next
    response.write "</tr>"

    rstCategorie.MoveFirst
    While not rstCategorie.EOF
    response.write "<tr>"
    For i=0 to rstCategorie.Fields.Count-1
    response.write "<td>" & rstCategorie(i) & "</td>"
    Next
    response.write "</tr>"
    rstCategorie.MoveNext
    Wend
    response.write "</TABLE>"
    End if

    Set rstCategorie=Nothing
    dbconn.Close
    %>


    ps
    la linea 37 è questa:
    set rstCategorie = ObjConn.Execute(SQL)

  2. #2
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994
    cos'è ObjConn? te lo dico io...niente
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

  3. #3
    ma me la puoi dare una mano?

  4. #4
    Se ti mando un pvt cn il db ed il file asp puoi dargli un'occhiata?
    Mi faresti un gran favore...

  5. #5
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994
    Originariamente inviato da fbdesign
    Se ti mando un pvt cn il db ed il file asp puoi dargli un'occhiata?
    Mi faresti un gran favore...
    intendevo..objconn non è un oggetto...dbconn è un oggetto
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

  6. #6
    Originariamente inviato da Sypher
    intendevo..objconn non è un oggetto...dbconn è un oggetto
    Ma mi puoi aiutare o no??

  7. #7
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994
    codice:
    <%
    set dbconn = server.createobject("adodb.connection")
    dbconn.open(application("strconn"))
    set rstcategorie = server.createobject("adodb.recordset")
    dim sql
    SQL = "SELECT * FROM parco_auto"
    set rstCategorie = dbconn.Execute(SQL)
    
    if not rstCategorie.EOF then
    response.write "<TABLE BORDER=0><tr>"
    For i=0 to rstCategorie.Fields.Count-1
    response.write "<td>" & rstCategorie.fields(i).Name & "</td>" 
    Next
    response.write "</tr>"
    
    rstCategorie.MoveFirst
    While not rstCategorie.EOF
    response.write "<tr>"
    For i=0 to rstCategorie.Fields.Count-1
    response.write "<td>" & rstCategorie(i) & "</td>"
    Next
    response.write "</tr>"
    rstCategorie.MoveNext
    Wend 
    response.write "</TABLE>"
    End if
    
    Set rstCategorie=Nothing
    dbconn.Close
    %>
    vedi così che succede
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

  8. #8
    funonzia...
    ciao grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.