Database in access !

di il
1 risposte

Database in access !

Ho convertito un database in access in asp!!
La visualizzazione dei dati(completa)funziona!

Mentre se tento di fare una ricerca mi da sto errrore del cax.....

Mi potete aiutare?

ecco l'errore:

Microsoft OLE DB Provider for ODBC Drivers errore "80004005'

[Microsoft][Driver ODBC Microsoft Access] Impossibile trovare il file "(sconosciuto)".

/Query1_1.ASP, riga 15


ecco il codice:


<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-1252">
<TITLE>Query1</TITLE>
</HEAD>
<BODY>
<%
Param = Request.QueryString("Param")
Data = Request.QueryString("Data")
'----------------
' db2.mdb e' il nome del tuo database
'----------------

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("db2.mdb")

sql = "SELECT Tabella1.Cilente, Tabella1.Anni FROM Tabella1 WHERE (((Tabella1.Cilente)=" & Request.QueryString("[Che nome?]") & ")) "

If cstr(Param) <> "" And cstr(Data) <> "" Then
sql = sql & " And [" & cstr(Param) & "] = " & cstr(Data)
End If

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3

%>
<TABLE BORDER=1 BGCOLOR=#ffffff CELLSPACING=0><FONT FACE="Arial" COLOR=#000000><CAPTION><B>Query1</B></CAPTION>

<THEAD>
<TR>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE="Arial" COLOR=#000000>Cilente</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE="Arial" COLOR=#000000>Anni</FONT></TH>

</TR>
</THEAD>
<TBODY>
<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
%>
<TR VALIGN=TOP>
<TD BORDERCOLOR=#c0c0c0 ><FONT SIZE=2 FACE="Arial" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("Cilente").Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT SIZE=2 FACE="Arial" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("Anni").Value)%><BR></FONT></TD>

</TR>
<%
rs.MoveNext
loop%>
</TBODY>
<TFOOT></TFOOT>
</TABLE>
</BODY>
</HTML>



--Datemi una leva e vo solleverò il mondo-------

1 Risposte

  • Re: Database in access !

    Io i database li mappo così -->

    dim strCode
    strCode="Mia_PassWord"
    Set Conn=Server.CreateObject("ADODB.Connection")
    strConn="driver={Microsoft Access Driver (*.mdb)}; "
    strConn=strConn & " DBQ=" & Server.MapPath("Nome_Data.mdb")
    strConn=strConn & ";pwd=" & strCode
    Conn.Open (strConn)
    sql = "SELECT * FROM Tabella"

    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, conn ,3,3

    e non ho nessun problema. Ciaaaoouz!!!!!!!
Devi accedere o registrarti per scrivere nel forum
1 risposte