Previously my C# app used this command to create an Excel file:
try
{
//SELECT INTO command
string cnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + AccfilePath +
";Persist Security Info=False";
ConnOpen(cnStr);
using (connectionToDatabase)
{
//Give the Export Table (destination) a Name
//baseTblName = dt.TableName;
//Generate the SQL string to SELECT * INTO the NEW table in destination
string selectcmd = "SELECT * INTO [Excel 12.0;Database=c:\\"+ExfilePath+"]." + tblName + " FROM " + tblName;
using (OleDbCommand createCmd = new OleDbCommand(selectcmd, connectionToDatabase))
{
createCmd.ExecuteNonQuery();
}
ConnClose();
}
}
I have moved to Win 7 64 bit and the OleDbCommand now gives me a "Failure Creating File". I have gone so far as to make the user an Administrator because I assumed it was a security issue.