Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 19
  1. #1

    Aiuto per pagina che funziona in locale e nn online

    Ciao a tutti, ho una pagina asp con un piccolo motore di ricerca interno, che in base ai campi riempiti nella form, effettua ogni volta ricerche su tre tabelle diverse (progetti, schede e retini).
    Il problema è che la pagina funziona perfettamente testandola in locale, mentre mettendola online su aruba, dà errore su tutte le subquery! VVoVe:
    Posto il pezzo di codice "incriminato":

    codice:
    '####################################################################
    	'RICERCA
    '####################################################################		
    
    		parametri = " "		
    		if request ("tipology") <> "000" and request ("tipology") <> "" then		
    		   query_sql="SELECT progetti.codice, progetti.nome as nome, tipologiep.nome as nomet FROM progetti INNER JOIN (tipologiep INNER JOIN tip_prog ON tipologiep.id = tip_prog.id_tip) ON progetti.codice = tip_prog.id_prog  WHERE tipologiep.id = '"& request("tipology") & "'" 
    		   query_acc ="SELECT progetti.codice FROM progetti INNER JOIN (tipologiep INNER JOIN tip_prog ON tipologiep.id = tip_prog.id_tip) ON progetti.codice = tip_prog.id_prog  WHERE tipologiep.id = '"& request("tipology") & "'"		  
    		elseif request("code") <> "" then
    			parametri = parametri & "and codice like '%" & request("code") & "%' "
    		    query_sql="select * from progetti where 1 = 1  " & parametri & " order by codice" 
    		    query_acc="select codice from progetti where 1 = 1  " & parametri & " order by codice" 
    		elseif request("name") <> "" then
    			parametri = parametri & "and nome like '%" & request("name") & "%' "	
    		    query_sql="select * from progetti where 1 = 1  " & parametri & " order by codice" 
    			query_acc="select codice from progetti where 1 = 1  " & parametri & " order by codice" 
    		elseif request("screencode")<>"" then			
    			query_sql="select * from progetti where codice IN ( select id_prog from prog_ret where id_ret LIKE '%" & request("screencode") &"%' );"
    			query_acc="select codice from progetti where codice IN ( select id_prog from prog_ret where id_ret LIKE '%" & request("screencode") &"%' );"
    		elseif request("datasheet") <>"" then
    			query_sql="select * from progetti where codice IN (select cod_prog from schede where codice ='" & request("datasheet") & "')"
    			query_acc="select codice from progetti where codice IN (select cod_prog from schede where codice ='" & request("datasheet") & "')"
    		else 
    		    query_sql = "select * from progetti where 1=2 order by codice"
    		    query_acc = "select codice from progetti where 1=2 order by codice"
    		end if		
    		
    '####################################################################
    	'VISUALIZZAZIONE ELENCO SCHEDE TECNICHE
    '####################################################################
    		if request("datasheet")<>"" then
    		query_sql_m= "SELECT codice FROM schede WHERE codice = '"& request("datasheet") & "'"
    		elseif request("screencode")<>"" then
    		query_sql_m= "SELECT id_scheda FROM applicazioni WHERE id_ret ='" &request("screencode") &"'"
    		else
    		query_sql_m= "SELECT  schede.codice FROM schede WHERE cod_prog IN ( " & query_acc & ");"
    		end if
            set rs_m=server.CreateObject("ADODB.recordset") 		
    		'response.write (query_sql_m)
    		'response.end
    		rs_m.Open query_sql_m,connection,3,3 		
    '####################################################################
    	'VISUALIZZAZIONE ELENCO RETINI ED ANTEPRIME
    '####################################################################
    		if request("screencode")<>"" then
    		query_sql_r= "select codice as retino from retini where codice LIKE '%" & request("screencode") &"%';"
    		elseif request("datasheet")<>"" then
    		query_sql_r= "select id_ret as retino from applicazioni where id_scheda in (" & query_sql_m & ");"
    		else
    		query_sql_r= "SELECT  id_ret as retino FROM prog_ret WHERE id_prog IN ( " & query_acc & ");"		
    		end if
            set rs_r=server.CreateObject("ADODB.recordset") 		
    		'response.write (query_sql_m)
    		'response.end
    		rs_r.Open query_sql_r,connection,3,3 		if not rs_r.EoF then
    		do while not rs_r.EoF
    		filenamer= rs_r.fields("retino") & "_s.jpg"
    		set fileCreater=CreateObject("Scripting.FileSystemObject") 'crea l'oggetto
    		Existentfiler=fileCreater.FileExists(Server.MapPath("admin/immagini/"&filenamer))
    		if Existentfiler= true then
    		immaginer= "admin/immagini/"&filenamer
    		else 
    		immaginer="admin/immagini/vuota.gif"
    		end if
    		elencor= elencor &  " " & Ucase(rs_r.fields("retino")) & "
    "
    		anteprimar= anteprimar & "[img]"& immaginer & "[/img]" & bgcol
    		rs_r.movenext		
    		loop 			
    		end if
    		
    '####################################################################
    	'CREAZIONE RS, CONTROLLO IMMAGINI, GENERAZIONE STRINGHE ELENCO DX
    '####################################################################
    
    		set rs=server.CreateObject("ADODB.recordset") 		
    		'response.write (query_sql)
    		'response.end
    		rs.Open query_sql,connection,3,3
    		pippo = ""
    		do while not rs.eof 				
    		filename= rs.fields("codice") & "_s.jpg"
    		set fileCreate=CreateObject("Scripting.FileSystemObject") 'crea l'oggetto
    		Existentfile=fileCreate.FileExists(Server.MapPath("admin/immagini/"&filename))
    		if Existentfile= true then
    		immagine= "admin/immagini/"&filename
    		else 
    		immagine="admin/immagini/vuota.gif"
    		end if
    		elencop= elencop & " " & Ucase(rs.fields("codice")) & " - " & Ucase(rs.fields("nome")) & "
    "
    		anteprimap= anteprimap & "[img]"& immagine & "[/img]" & bgcol
    		rs.movenext
    		
    		loop 			
    		
    		rs.close 
    		set rs=nothing
    		
    		if request("id") <> "" then
    		id = request("id")
    		else
    		id = 0
    		end if
    		
    	%>
    In rosso le query che danno questo errore:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e21' ODBC driver does not support the requested properties

    Il db è mySql.
    Qualcuno ci capisce qualcosa?
    Allie Graywords

  2. #2
    Guarda prima di tutto questo interessante 3D, riguardante MySql con ASP e la possibilità che l'errore sia in realtà un access denied error.....in ogni caso, puoi postare la tua connection? Punta all'indirizzo corretto del database?
    E' nato www.lombardiamotori.it

    www.universocase.it: il primo portale italiano di annunci immobiliari gratuiti e autogestiti!

  3. #3
    Grazie, ora leggo l'articolo che mi hai indicato.
    La connessione comunque è corretta, visto che le altre pagine del sito funzionano: la stessa pagina che ho postato, commentando le due query che danno errore, nelle altre parti della ricerca funziona
    Allie Graywords

  4. #4
    Up per favore
    L'articolo purtroppo non risolve il mio problema :master:
    Allie Graywords

  5. #5
    Per favore, qualcuno può aiutarmi? Non so dove sbattere la testa!
    Allie Graywords

  6. #6
    up
    Allie Graywords

  7. #7
    Allie Graywords

  8. #8
    Prova a togliere i cursori (,3,3)
    controlla poi che la versione di mysql che hai sul server sia la stessa che hai in locale
    Purtroppo bisogna imparare che il computer non sbaglia...fa solo quello che gli dici di fare

    www.netpolaris.it

  9. #9
    Shagrat grazie, inziavo a disperare che qualcuno mi desse una mano!

    Ho provato a togliere i cursori e l'errore è cambiato, ora dice:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select codice from progetti where 1=2 order by codice)' at line

    /prova_metco/projectsRicerca.asp, line 65
    Allie Graywords

  10. #10
    qual'è la riga 65? di solito l'errore sta prima di quello che scrive lui...
    Purtroppo bisogna imparare che il computer non sbaglia...fa solo quello che gli dici di fare

    www.netpolaris.it

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.