J
Jon Cosby
How do you append an Excel spreadsheet? This code
string qry;
string mdbConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
"F:\\Databases\\bellpeek.mdb;";
OleDbConnection mdbConn = new OleDbConnection(mdbConnStr);
qry = "SELECT ProductName, OrderDate, Qty, OrderItems.Price " +
"INTO [Excel 8.0;Database=" + Application.StartupPath +
"\\book1.xls].[Orders] " + (sql code here);
OleDbCommand cmd = new OleDbCommand(qry, mdbConn);
mdbConn.Open();
cmd.ExecuteNonQuery();
mdbConn.Close();
only works if I create a new spreadsheet for each user selection. I want to
add the results to the original spreadsheet. Is there a way to do this?
Jon Cosby
string qry;
string mdbConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
"F:\\Databases\\bellpeek.mdb;";
OleDbConnection mdbConn = new OleDbConnection(mdbConnStr);
qry = "SELECT ProductName, OrderDate, Qty, OrderItems.Price " +
"INTO [Excel 8.0;Database=" + Application.StartupPath +
"\\book1.xls].[Orders] " + (sql code here);
OleDbCommand cmd = new OleDbCommand(qry, mdbConn);
mdbConn.Open();
cmd.ExecuteNonQuery();
mdbConn.Close();
only works if I create a new spreadsheet for each user selection. I want to
add the results to the original spreadsheet. Is there a way to do this?
Jon Cosby