I am looking at the Cetin's code of extracting data from an excel into a cursor. What I get is the following:
1. The names of the fields of the cursor are taken from the 1st row of the spreadsheet.
Question: Is this always the case?
2. The types of fields are MEMO for all character fields.
Question: Can I define types of the fields instead of all Char fields getting MEMO type:
This is the snipet of the code:
lcConStr = 'Provider=Microsoft.ACE.OLEDB.12.0;'+;
'Data Source='+m.lcDataSource+';'+;
'Extended Properties="Excel 12.0;HDR='+;
IIF(m.lFirstRowHasHeader,'Yes','No')+'"'
m.tcQuery = 'select * from [sheet1$]'
m.tcCursorName = 'C_SHEET1'
Local oConn As 'ADODB.Connection'
Local oRS As ADODB.RecordSet
oConn = Createobject('ADODB.Connection')
oConn.Mode= 1
oConn.Open( m.tcConStr )
oRS = oConn.Execute(m.tcQuery)
Local xDOM As 'MSXML.DOMDocument'
xDOM = Createobject('MSXML.DOMDocument')
toRS.Save(xDOM, 1)
Xmltocursor(xDOM.XML, m.tcCursorName)
oRS.Close
oConn.Close
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham