Modber
1

MSOffice



: 1
: 1: 8.3, 1: 8.2, 1: 8.1
:
2014-04-08
1384 
acsent
0  

, MS Excel : , , .

// Excel
//
// :
// —
// —
// — "" — ""
// , "1", "2"
//
// :
//
//
Excel__ADO(, , = , = 0, = 0)

#
(" Excel");
#

//1 = "HDR=YES;"
1 = "HDR=NO;";

="Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + () +" ;Extended Properties=""Excel 8.0;" + 1 + "IMEX=1;""";

Connection = COM("ADODB.Connection");
Connection.ConnectionString = ;


Connection.Open();

(" Excel" );
;
;

RS = COM("ADODB.Recordset");

=
"SELECT
| .*
|FROM
| [" + + "$] as ";


RS.Open(, Connection);

(" ");
;
;

= ;

=

= 1 RS.Fields.Count
= RS.Fields.Item( — 1);
= ..("" + ,, .Name);
;




= ..(.);
;

;

= 0;
= RS.RecordCount;

RS.EOF() = 0

= + 1;

#
(" : " + () + " " + ());
();
#

<
RS.MoveNext();
;
;

> 0 >
;
;

= .();

=

= 1 RS.Fields.Count

= RS.Fields.Item( — 1);
["" + ] = .Value;

;





= RS.Fields.Item(. — 1);
[.] = .Value;

;

;

//
RS.MoveNext();

;

//

RS.Close();
Connection.Close();

;

// Excel
//
// :
// 렠 —
// 򠠠 —
// — "" — ""
// , "1", "2"
// XLS — COM "Excel.Application"
//
// :
//
//
Excel__COM(, , = , = 0, = 0, XLS = )

#
(" Excel");
#

XLS =
XLS = COM("Excel.Application");
XLS.Visible = ;
XLS.DisplayAlerts = ;
;


Book = XLS.Workbooks.Open(,, );

(" Excel" );
;
;

= Book.Sheets(1);
= .Cells(1,1).SpecialCells(11).Column;
ꠠ = .Cells(1,1).SpecialCells(11).Row;

= ;

=

= 1
= ..("" + );
;




= ..(.);
;

;

= ?( = 0, 1, );
= ?( = 0, , );
= (, );

=

#
(" : " + () + " " + ());
();
#

= .();

=

= 1

= .Cells(, );
["" + (, "=0")] = .Value;

;





= .Cells(, .);
[.] = .Value;

;

;

;

XLS.Application.Quit();
;

// Excel
//
// :
// 렠 —
// 򠠠 —
// — "" — ""
// , "1", "2"
// XLS — COM "Excel.Application"
//
// :
//
//
Excel__COMArray(, , = , = 0, = 0, XLS = )

#
(" Excel");
#

XLS =
XLS = COM("Excel.Application");
XLS.Visible = ;
XLS.DisplayAlerts = ;
;


Book = XLS.Workbooks.Open(,, );

(" Excel" );
;
;

= Book.Sheets(1);
= .Cells(1,1).SpecialCells(11).Column;
ꠠ = .Cells(1,1).SpecialCells(11).Row;

= ;

=

= 1
= ..("" + );
;



= 0;

= ..(.);
= (, .);
;

= (, );

;

= ?( = 0, 1, );
= ?( = 0, , );
= (, );

// COMSafeArray
= .Range(.Cells(, 1), .Cells(, )).Value;
ꠠ = .GetUpperBound(1);

= 1

#
(" : " + () + " " + ());
();
#

= .();

=

= 1

["" + (, "=0")] = .GetValue(, );

;





[.] = .GetValue(., );

;

;

;

XLS.Application.Quit();
;

// Excel
//
// :
// —
// XLS — COM "Excel.Application"
//
// :
//
//
Excel_(, XLS = )

XLS =
XLS = COM("Excel.Application");
XLS.Visible = ;
XLS.DisplayAlerts = ;
;


Book = XLS.Workbooks.Open(,, );

;
;

= ;
XLS.Sheets
.(.Name);
;

XLS.Application.Quit();
;



     1


.
.




8 (499) 350-80-26()
8 (812) 627-15-62()

(0)