codice:
datam = "23/09/2006" ' PER ESEMPIO, MA NEL DATABASE VALE :
23/09/2006 00:00:00
qualsiasi valore metto come datam, da' sempre errore...
datam_elaborato = mssqlDate(datam)
str_insert = str_insert & "INSERT INTO news (recn, datam, on_line, id_scat, news_breve, news_meta_description, titolo, img_s_path, img_b_path, img_big_link, img_b2_path, img_b3_path, importata_automaticamente, importata_automaticamente_data) "
str_insert = str_insert & "VALUES ("&recn&", convert(datetime,'"& datam_elaborato &"',110), '"&on_line&"', "&id_scat&", '"&news_breve&"', '"&news_meta_description&"', '"&titolo&"', '"&img_s_path&"', '"&img_b_path&"', '"&img_big_link&"', '"&img_b2_path&"', '"&img_b3_path&"', 'yes', '"&dataoggi&"') "
e la funzione per la data:
codice:
function mssqlDate(strData)
dim strGiorno
dim strMese
dim strAnno
dim strOra
dim strMinuti
dim strSecondi
strgiorno = day(strData)
if Len(strGiorno) = 1 then
strGiorno = "0" & strGiorno
end if
strMese = Month(strData)
if Len(strMese) = 1 then
strMese = "0" & strMese
end if
strAnno = Year(strData)
strOra = Hour(strData)
if Len(strOra) = 1 then
strOra = "0" & strOra
end if
strMinuti = Minute(strData)
if Len(strMinuti) = 1 then
strMinuti = "0" & strMinuti
end if
strSecondi = Second(strData)
if Len(strSecondi) = 1 then
strSecondi = "0" & strSecondi
end if
' anno-mese-giorno
mssqlDate = strAnno & "-" & strMese & "-" & strGiorno & " " & strOra & ":" & strMinuti & ":" & strSecondi
End function
SE INVECE DI INSERT INTO, USO IL RECORDSET, l'ERRORE e' IL SEGUENTE :
dopo una venitna di record importati, appare :
codice:
Microsoft Cursor Engine error '80004005'
Data provider or other service returned an E_FAIL status.