Skip to main content

AccessTr.neT


Access Form Kullanmadan Döviz Kuru Alma

Access Form Kullanmadan Döviz Kuru Alma

#3
userforma TxtTrh adlı metin kutusu ekleyip butona aşağıdaki kodu ekleyerek dener misiniz?
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
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
RE: Access Form Kullanmadan Döviz Kuru Alma - Yazar: berduş - 05/05/2020, 18:54
Task