P
Przemek Wrzesinski
Hi, I'm trying to add additional column using 'alter table' command via
OleDB to Excel workbook (one sheet called queExportBOND):
Dim strConn As String
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Temp\BOND.xls;" & _
"Extended Properties=""Excel 8.0;HDR=YES;"""
Dim oCn As New OleDbConnection(strConn)
Try
oCn.Open()
Try
Dim oCmd As New OleDbCommand("ALTER TABLE [queExportBOND] ADD new_column
Double", oCn)
oCmd.ExecuteNonQuery()
Finally
oCn.Close()
End Try
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Unfortunately I'm receiving the error 'Cannot find table or range'. How can
I correct this ? What I'm doing wrong ?
TIA
Przemek
OleDB to Excel workbook (one sheet called queExportBOND):
Dim strConn As String
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Temp\BOND.xls;" & _
"Extended Properties=""Excel 8.0;HDR=YES;"""
Dim oCn As New OleDbConnection(strConn)
Try
oCn.Open()
Try
Dim oCmd As New OleDbCommand("ALTER TABLE [queExportBOND] ADD new_column
Double", oCn)
oCmd.ExecuteNonQuery()
Finally
oCn.Close()
End Try
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Unfortunately I'm receiving the error 'Cannot find table or range'. How can
I correct this ? What I'm doing wrong ?
TIA
Przemek