Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 18 su 18
  1. #11
    trova.CommandText = "SELECT stato FROM db_badge WHERE num_badge='"& Request.Form("trovando") &"'"
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  2. #12
    Utente di HTML.it L'avatar di VaLvOnAuTa
    Registrato dal
    Jun 2002
    Messaggi
    2,003
    Oddio io non sono espertissimo di ASP (ho cominciato da poco) ma mi sembra corretto.
    sei sicuro che trova è un oggetto?
    l'hai dichiarato con
    set trova = Server.CreateObject("ADODB.Command")?
    :master:

  3. #13
    certo che ho dichiarato Set trova = Server.CreateObject("ADODB.Recordset") e l'errore è solo quello CommandText, ma sei sicuro che fa bene per asp? Non era per PHP o VB?
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  4. #14
    Utente bannato
    Registrato dal
    Jan 2003
    Messaggi
    2,407
    ti serve un motore di ricerca su 2 campi del db??

    se vuoi ti posto il mio che va benissimo...

    ciao

  5. #15
    bongiorno, anche se il tuo nick "certenotti" preferiresti di dirti buonaotte? eh eh
    Allora postalo e ci provo.
    Grazie
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  6. #16
    Utente bannato
    Registrato dal
    Jan 2003
    Messaggi
    2,407
    codice:
    		<%
    
                testo = Request("chiavericerca")
    
    			'apro la connessione con il db
    			set myConn1 = server.CreateObject("ADODB.Connection")
    			
    			dim strConnDb1
    			strConnDb1 = ""
    			strConnDb1 = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & server.mappath("/mdb-database/news.mdb")
    			myConn1.Open(strConnDb1)
    					
    			mySqlSelect1 = "SELECT * from notizie WHERE titolo LIKE '%"& testo &"%' OR argomento LIKE '%"& testo &"%' order by data desc"
    			
    			set myRSComS1 = server.CreateObject("ADODB.Recordset")
    			
    			myRSComS1.Open mySqlSelect1, myConn1
    				
    		
    			if not(myRSComS1.EOF) and not(myRSComS1.BOF) then	
    		
    				do while not(myRSComS1.EOF)	
    		%>
    
    	    <table width="500" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
    		 <tr>
    		  <td>
    		  <font face="verdana" size="2" color="#FF0000">
    		  <font color="#05326f"><%=myRSComS1("data")%></font><%=myRSComS1("titolo")%>
    		  </font>
    		  </td>
    		 </tr>
    		 <tr>
    		  <td>
    		  <p align="justify">
    		  <font face="verdana" size="2" color="#000000">
    			<%
    			Testoparziale=""
    			Testoparziale=myRSComS1("argomento")
    			pos=150
                response.write(left(Testoparziale, pos) &"... [Continua]")
    			%>
    		  </font></p>
    		  </td>
    		 </tr>
    		</table>
    	    <table width="500" height="10" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
    		 <tr>
    		  <td></td>
    		 </tr>
    		</table>
    
    		<%
    					myRSComS1.MoveNext
    				loop
    			else
    		
    		%>
    
    	    <table width="500" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
    		 <tr>
    		  <td>
    		  <p align="justify">
    		  <font face="verdana" size="2" color="#000000">
              La ricerca che avete efettuato non ha dato esiti; le parole da voi inserte non risultano all'interno di nessuna notizia.
    		  </font></p>
    		  </td>
    		 </tr>
    		</table>
    	    <table width="500" height="10" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
    		 <tr>
    		  <td></td>
    		 </tr>
    		</table>
    
    		<%
    			end if	
    		
    			myRSComS1.Close
    			set myRSComS1=nothing	
    			myConn1.Close
    			set myConn1=nothing
    			
    		%>
    ciao

  7. #17
    scusami, quello è di mysql.... uso sql 2000
    Ho provato e mi ha restituito l'errore dicendo

    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'num_badge'.
    /gestionebadget/trovax.asp, line 19

    la riga è
    -----------------------------------------------------------------
    mySqlSelect1 = "SELECT * from dbo.assegnatario, dbo.db_badge WHERE db_badge.num_badge LIKE '%"& testo &"%' OR cognome LIKE '%"& testo &"%' order by num_badge desc"
    ------------------------------------------------------------------

    e ho modificato
    ----------------------------------------------------------------
    mySqlSelect1 = "SELECT * from dbo.assegnatario, dbo.db_badge WHERE db_badge.num_badge=assegnatario.num_badge LIKE '%"& testo &"%' OR cognome LIKE '%"& testo &"%' order by num_badge desc"
    -----------------------------------------------------------------

    perchè sia nella tabella assegnatario e db_badge hanno lo stesso num_badge.

    e mi restiusce l'altro errore
    --------------------------------------------------------------------
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'LIKE'.
    /gestionebadget/trovax.asp, line 19

    la riga è sempre la stessa......
    come mai?
    --------------------------------------------------------------------
    ..:: GSFLASH ::..
    HTTP://WWW.GSFLASH.IT
    MCTS - ACP - OCP - ECDL
    Ubuntu 7.10/OpenSuse 10.3/Vista Premium/MacOSX Leopard
    My authentic japanese name is 薗田Sonoda (garden field) 大河 Taiga (big river)

  8. #18
    Utente bannato
    Registrato dal
    Jan 2003
    Messaggi
    2,407
    Originariamente inviato da gsflash
    scusami, quello è di mysql.... uso sql 2000
    Ho provato e mi ha restituito l'errore dicendo

    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'num_badge'.
    /gestionebadget/trovax.asp, line 19

    la riga è
    -----------------------------------------------------------------
    mySqlSelect1 = "SELECT * from dbo.assegnatario, dbo.db_badge WHERE db_badge.num_badge LIKE '%"& testo &"%' OR cognome LIKE '%"& testo &"%' order by num_badge desc"
    ------------------------------------------------------------------

    e ho modificato
    ----------------------------------------------------------------
    mySqlSelect1 = "SELECT * from dbo.assegnatario, dbo.db_badge WHERE db_badge.num_badge=assegnatario.num_badge LIKE '%"& testo &"%' OR cognome LIKE '%"& testo &"%' order by num_badge desc"
    -----------------------------------------------------------------

    perchè sia nella tabella assegnatario e db_badge hanno lo stesso num_badge.

    e mi restiusce l'altro errore
    --------------------------------------------------------------------
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'LIKE'.
    /gestionebadget/trovax.asp, line 19

    la riga è sempre la stessa......
    come mai?
    --------------------------------------------------------------------
    perchè non è per sql 2000 ops...

    devi modificare la connessione al db con quella adatta a sql 2000 ma la select per estrapolar le info dai campi dovrebbe poter rimanere invariata e quindi funzionare...


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.