allora ciao a tutti .. ho 2 db da uno devo aggiornare l'altro estraggo i record nel db che contiene gli aggionamenti e con update aggiorno il db vecchio ... questo è il mio codice che sto provando a fare...
errore che mi esce ...Codice PHP:<% ' CONTEOLLO AGGIONAENTI DA FARE PRELEVANDO TUTTI I RECORD DAL DB
dim rs_agg, sql_agg
Set rs_agg = Server.CreateObject("ADODB.Recordset")
sql_agg = "select * from agg_descrizioni_extra"
rs_agg.open sql_agg, dcnDB_ag
if not rs_agg.eof then
do until rs_agg.eof
%>
<%
'SE TROVA AGGIORNAMENTI DA FARE FA QUESTO ...
dim rs_agg2, sql_agg2, idhotel, descriptiontype_id,description_new,languagecode
idhotel= rs_agg("hotel_id")
descriptiontype_id= rs_agg("descriptiontype_id")
languagecode= rs_agg("languagecode")
description_new= rs_agg("description") & ""
description_new=replace(description_new,"'","''")
set rs_agg2 = Server.CreateObject("ADODB.Recordset")
sql_agg2 = "select * from descrizioni_extra where hotel_id="&idhotel&" and descriptiontype_id="&descriptiontype_id&" and languagecode='"&languagecode&"' "
rs_agg2.open sql_agg2, dcnDB
if not rs_agg2.eof then
do until rs_agg2.eof
'SE TROVA CORRISPONDENZA FA AGGIORNAMNETO ...
Dim rs_up, SQL_up
SQL_up = "UPDATE descrizioni_extra SET description='"&description_new&"' where hotel_id="&idhotel&" and descriptiontype_id="&descriptiontype_id&" and languagecode='"&languagecode&"' "
Set rs_up = Server.CreateObject("ADODB.Recordset")
rs_up.open sql_up, dcnDB
rs_agg2.movenext
loop
else
' SE NO TROVA CORRISPONDENZA FA INSERIMENTO
%>
INSERIMENTO RECORD
<%
end if
rs_agg2.close
set rs_agg2=nothing %>
ecc..
Tipo di errore:
Microsoft JET Database Engine (0x80040E14)
Errore di sintassi (operatore mancante) nell'espressione della query 'hotel_id= and descriptiontype_id= and languagecode='''.
/admin/aggiornamento_db_descr_extra.asp, line 37
linea 37 rs_agg2.open sql_agg2, dcnDB se stampo la select invece mi da:
select * from descrizioni_extra where hotel_id=98106 and descriptiontype_id=2 and languagecode='en'
dove sbaglio![]()
![]()

-
Rispondi quotando
