webForumDet fria alternativet
Logga in / Bli medlem

Problem med Run-Time error '440'

.NET

0 svar · 323 visningar · startad av znyder

Medlem sedan dec. 2002172 inlägg
Frågan#1

Jag håller på med ett auktionsprogram.
Det ska kolla igenom utgående auktioner och meddela vinnaren.

MEN!

Ibland funkar det smärtfritt och det skickas utan problem.. men ibland står det:

Run-Time Error '440':
Operations are not allowed when the object is closed.

Vad menas med det?
Jag testar med samma auktion... ibland funkar det ibland inte...

Någon som vet vart man ska börja kolla?

Detta är koden som triggar själva felmeddelandet..

If bidders("bid") >= rst("reservation") Then

Set end_a = con.Execute("select * from members where id=" & bidders("user_id") & "")

Set poSendMail = New vbSendMail.clsSendMail
poSendMail.SMTPHost = "mailout.comhem.se"
poSendMail.From = "pay@pbay.se"
poSendMail.FromDisplayName = "PBAY"
poSendMail.Recipient = "pontusholm@comhem.se"
poSendMail.ReplyToAddress = "pontusholm@comhem.se"
poSendMail.Subject = "Du vann auction med reservationspris!"
poSendMail.Message = "This is a test"
poSendMail.Send
Set poSendMail = Nothing
Set end_a = Nothing

Set end_a = con.Execute("insert into won_ids(auction_ID, typ_auction, user_ID, feedback_ID, feedback, datum) VALUES(" & rst("ID") & ", 1, " & rst("user_ID") & ", " & bidders("user_ID") & ", 0, '" & Now & "') ")
Set end_a = Nothing
Set end_a = con.Execute("insert into won_ids(auction_ID, typ_auction, user_ID, feedback_ID, feedback, datum) VALUES(" & rst("ID") & ", 2, " & bidders("user_ID") & ", " & rst("user_ID") & ", 0, '" & Now & "') ")
Set end_a = Nothing
Set end_a = con.Execute("update auctions set sold=1 WHERE ID=" & rst("id") & "")
Set end_a = Nothing

End If

Tacksam för hjälp.

257 ms totalt · 4 externa anrop · v20260731065814-full.1b2494f0
119 ms — deklarationer (db)
0 ms — hämta statistik (cache)
130 ms — hämta tråd, inlägg och bilagor (db)
124 ms — ändringar (db)