FoxyClasses - ExcelLib Dbf2Excel.ViaADO
Ramazan,
Yalniz oncelikle degisen Excel versiyonlarina ve VFPOLEDB'ye gore degisiklik gerekiyor (o yazildigi zaman VFPOLEDB yoktu).
Degisenler (benim gibi D:\Foxyclasses folderi kullaniyorsan):
MODIFY CLASS dbf2excel OF d:\foxyclasses\classes\excellib
*ViaADO method
Visual Fox Pro
1
2
3
4
5
6
7
8
9
10
| With oConnection
*!* .Provider = "MSDataShape"
*!* .ConnectionString = [Provider=MSDataShape.1;Persist Security Info=False;]+;
*!* [Data Source="Data Provider = MSDASQL;]+;
*!* [DSN=Visual FoxPro Database;UID=;SourceDB=]+this.DBCPath+[;]+;
*!* [SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;]+;
*!* [Deleted=Yes;";Data Provider=MSDASQL ]
.ConnectionString = [Provider=VFPOLEDB;Data Source=]+this.DBCPath
.Open
Endwith |
Visual Fox Pro
1
2
3
4
5
6
7
| *!*With .QueryTables.Add(oRs, .Range("A1")) && Add recordset to sheet
*!* .BackgroundQuery = .T.
*!* .AdjustColumnWidth = .T.
*!* .Refresh(.F.)
*!* Endwith
.Range('A1').CopyFromRecordSet( oRS )
oRS.Close() |
*loadRset method
Visual Fox Pro
1
2
| * .Source = [ SHAPE {]+tcSelect+[} ]
.Source = m.tcSelect |
Test kodu:
LOCAL loExporter as "dbf2excel" OF "d:\foxyclasses\classes\excellib.vcx"
loExporter = NEWOBJECT("dbf2excel","d:\foxyclasses\classes\excellib.vcx")
loExporter.DBCpath = _samples+'Data\testdata.dbc'
loExporter.ViaADO("FoxyExportedThis","employee")
Yen yaz 1907'ye yolla FB gelsin evinde yensin.
(sonra salaklar ciksin alin terine şike desin)