Originally posted by: Bob Scarle
Good article, it works well. One thing missing is how to read the
data from a spreadsheet once it has been opened. Heres how I did it.
COleVariant Var;
CString m_String;
COleDateTime m_Date;
// Read a string field from column 0
Rs.GetFieldValue (0, Var);
m_String = Var.pbVal;
// Clear the ole object
Var.Clear ();
// Read a date from column 3
Rs.GetFieldValue (3, Var);
m_Date = Var.date;
I only used a string and a date but check the help on VARIANT to find the other data members.
Hope this is of use.
Originally posted by: Zdenek Skalnik
I think connect string for Excel 97 is "Excel 8.0;" instead "Excel 97;"
as is shown in table.
Zdenek Skalnik (Dr. Dexter)
ReplyOriginally posted by: Steve Rosenberg
I was unable to make my CDaoRecordset class open the database using this method. If you could provide a piece of code that works I would appreciate it.
Reply