- Katılım
- 1 Mart 2005
- Mesajlar
- 22,248
- Excel Vers. ve Dili
-
Win7 Home Basic TR 64 Bit
Ofis-2010-TR 32 Bit
Merhaba arkadaşalr.
Vbscript ile ADODB kullanarak mdbye kayıt ve listeleme çalışması yaptım.
kodlar aşağıda ve dosya ektedir.
Vbscript ile ADODB kullanarak mdbye kayıt ve listeleme çalışması yaptım.
kodlar aşağıda ve dosya ektedir.
Kod:
sub dbye_kayit
ad = inputbox ("Bir ad giriniz :","Mdbye Kayıt")
sehir=inputbox ("Bir Şehir Giriniz :","Mdbye Kayıt")
if ad <> "" then
rs.addnew
rs("ADI")=ad
rs("SEHIR")=sehir
rs.update
if msgbox ("Kayıt Başarı ile girildi." & vblf & "Başka Kayıt Girmek İstiyormusunuz ?",vbyesno,"EVREN")=vbyes then call dbye_kayit
end if
end sub
sub listele
Const ForReading = 1, ForWriting = 2
Set f = fso.OpenTextFile(fso.GetAbsolutePathName("") & "\mdb_Listesi.txt", ForWriting, True)
f.WriteBlankLines 2
f.WriteLine "================================================================================================="
f.writeblanklines 1
f.writeline " H A Z I R L A Y A N E V R E N G İ Z L E N 02.10.2009 "
f.writeline " Email : evrengizlen@hotmail.com"
f.writeline ""
f.writeline "Bu dosya İle mdb dosyasına kayıt yapabilir ve dosyasındaki verileri listelersiniz"
f.writeline ""
f.writeline "================================================================================================="
f.WriteBlankLines 2
rs.movefirst
do while not rs.eof
f.writeline rs(1).value & vbtab & vbtab & rs(2).value
rs.movenext
loop
CreateObject("Shell.Application").Open fso.GetAbsolutePathName("") & "\mdb_Listesi.txt"
end sub
set conn = createobject("ADODB.CONNECTION")
set rs = createobject("ADODB.RECORDSET")
set fso = createobject("Scripting.FileSystemObject")
conn.open "Provider=microsoft.jet.oledb.4.0;data source=" & fso.GetAbsolutePathName("") & "\Test.Mdb;"
rs.open "Select * from [Tablo1]", conn, 1, 3
call dbye_kayit
if msgbox ("Tüm Kayıtları Görmek İsiyormusunuz ?",vbyesno,"EVREN")=vbyes then call listele
rs.close
set rs=nothing
conn.close
set conn = nothing
Ekli dosyalar
-
8.9 KB Görüntüleme: 53