Ado ile Toplama

Katılım
30 Ekim 2010
Mesajlar
108
Excel Vers. ve Dili
2007 Türkçe
Kod:
Set con = CreateObject("adodb.connection")
con.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & kk & ";"
Set rs = CreateObject("adodb.recordset")
sorgu = "SELECT SUM(MALIYET) FROM [URUN_DOSYALARI] where [URUN_KODU] ='" & ListBox1.List(ListBox1.ListIndex, 0) & "'"
rs.Open sorgu, con, 1, 3

Range("a2").CopyFromRecordset rs
textbox1.Value = Range("a2").Text
yukarıdaki kod'da rs kaydını textbox1 'e sayfaya göndermeden nasıl yazdırabilirim.
 

Haluk

𐱅𐰇𐰼𐰚
Katılım
7 Temmuz 2004
Mesajlar
12,271
Excel Vers. ve Dili
64 Bit 2010 - İngilizce
+
Google Sheets
+
JScript
Kodunuzda aşağıdaki satırları silip,

Kod:
Range("a2").CopyFromRecordset rs
textbox1.Value = Range("a2").Text

bunu kullanın .....

Kod:
TextBox1.Value = RS(0)
.
 
Üst