I get the error message:
"Exception Details: System.Data.Ole Db.OleDbExcepti on: Table 'Hank' already
exists."
when executing the following code:
Dim AccessConn As New System.Data.Ole Db.OleDbConnect ion
("Provider=Micr osoft.Jet.OLEDB .4.0; Data Source= c:\My Documents\db1.m db")
AccessConn.Open ()
'New sheet in Workbook
Dim AccessCommand As New System.Data.Ole Db.OleDbCommand ("SELECT *
INTO [Excel 8.0; DATABASE=c:\My Documents\Book1 1.xls; HDR=NO;].[Hank] FROM
myTable", AccessConn)
AccessCommand.E xecuteNonQuery( )
AccessConn.Clos e()
(Code is provided by Paul Clement, 9-13-2005)
It's interesting that the data from the table is exported to the newly
created workbook, "Book11", and the data resdies in the worksheet "Hank", but
the error message "Table 'Hank' already exists" comes up anyway.
What is the best way to get rid of the error as my ASP.Net application bombs?
Thank you, Mark
"Exception Details: System.Data.Ole Db.OleDbExcepti on: Table 'Hank' already
exists."
when executing the following code:
Dim AccessConn As New System.Data.Ole Db.OleDbConnect ion
("Provider=Micr osoft.Jet.OLEDB .4.0; Data Source= c:\My Documents\db1.m db")
AccessConn.Open ()
'New sheet in Workbook
Dim AccessCommand As New System.Data.Ole Db.OleDbCommand ("SELECT *
INTO [Excel 8.0; DATABASE=c:\My Documents\Book1 1.xls; HDR=NO;].[Hank] FROM
myTable", AccessConn)
AccessCommand.E xecuteNonQuery( )
AccessConn.Clos e()
(Code is provided by Paul Clement, 9-13-2005)
It's interesting that the data from the table is exported to the newly
created workbook, "Book11", and the data resdies in the worksheet "Hank", but
the error message "Table 'Hank' already exists" comes up anyway.
What is the best way to get rid of the error as my ASP.Net application bombs?
Thank you, Mark
Comment