SorguTarihi = Me.TxtTrh
Set xmldoc = CreateObject("Msxml.DOMDocument")
Dim DovizListesi, Dovizler As Object
xmldoc.async = False
If SorguTarihi <> Date Then
xmldoc.Load "http://www.tcmb.gov.tr/kurlar/" & CStr(Format(SorguTarihi, "yyyymm") & "/" & Format(SorguTarihi, "ddmmyyyy")) & ".xml"
Else
xmldoc.Load "http://www.tcmb.gov.tr/kurlar/today.xml"
End If
Set DovizListesi = xmldoc.DocumentElement.SelectNodes("Currency")
On Error Resume Next
Set baglan = CreateObject("adodb.connection")
baglan.Open "provider=Microsoft.ACE.OLEDB.12.0;data source=" & ThisWorkbook.Path & "\Döviz.accdb"
For Each Dovizler In DovizListesi
SqlEkle = " INSERT INTO [Döviz] (DövizAdi, [DövizAlis], [DövizSatis],[EfektifAlis],[EfektifSatis]) " & _
" VALUES ('" & Dovizler.SelectSingleNode("Isim").Text & "',CCur('" & _
Replace(Dovizler.SelectSingleNode("ForexBuying").Text, ".", ",") & "'), CCur('" & _
Replace(Dovizler.SelectSingleNode("ForexSelling").Text, ".", ",") & "'),CCur('" & _
Replace(Dovizler.SelectSingleNode("BanknoteBuying").Text, ".", ",") & "'),CCur('" & _
Replace(Dovizler.SelectSingleNode("BanknoteSelling").Text, ".", ",") & "'))"
'Debug.Print SqlEkle
baglan.Execute SqlEkle
If Dovizler.SelectSingleNode("Isim").Text = "PAKİSTAN RUPİSİ" Then
Exit For
End If
Next
Set xmldoc = Nothing
userforma TxtTrh adlı metin kutusu ekleyip butona aşağıdaki kodu ekleyerek dener misiniz?