Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.sdk
|
|||
|
|||
![]()
I'm having problems populating an Excel spreadsheet using ADO.Net's OLEDB
provider. The issue is that inserting strings with full stops in causes the next subsequent insert to fail. E.g. INSERT INTO [Template$A8:A8] VALUES ('This sentence has a full stop.') INSERT INTO [Template$A9:A9] VALUES ('This sentence does not have a full stop') Executing either one of these statements does not cause an error. Executing both in a row, causes an error to be reported at the location of the full stop (although it is then purported as being a # character). Closing the OLE DB Connection between the INSERTs does not resolve the issue - even if I rename the Excel spreadsheet and then reopen it. My code uses OleDbConnection and OleDbCommand objects to perform the inserts. Any ideas? |
#2
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.sdk
|
|||
|
|||
![]()
I think there's more efficient ways of populating Excel with ADO
Erlandsen Data Consulting http://www.erlandsendata.no/english/vba/adodao/ keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Kevin Harrison" wrote: I'm having problems populating an Excel spreadsheet using ADO.Net's OLEDB provider. The issue is that inserting strings with full stops in causes the next subsequent insert to fail. E.g. INSERT INTO [Template$A8:A8] VALUES ('This sentence has a full stop.') INSERT INTO [Template$A9:A9] VALUES ('This sentence does not have a full stop') Executing either one of these statements does not cause an error. Executing both in a row, causes an error to be reported at the location of the full stop (although it is then purported as being a # character). Closing the OLE DB Connection between the INSERTs does not resolve the issue - even if I rename the Excel spreadsheet and then reopen it. My code uses OleDbConnection and OleDbCommand objects to perform the inserts. Any ideas? |
#3
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.sdk
|
|||
|
|||
![]()
My problem with implementing other methodologies is that:
- the component needs to be authored in .Net - I'm using an excel template, and only need to populate a subsection - so cannot use an implicit a schema for a dataset to be able to determine the update and insert command syntax. I cannot use an explicit schema, because I cannot ascertain the datatypes of the cells (!). The issue with the fullstop does appear related to the cell format. Thanks. Kev. "keepitcool" wrote in message ... I think there's more efficient ways of populating Excel with ADO Erlandsen Data Consulting http://www.erlandsendata.no/english/vba/adodao/ keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Kevin Harrison" wrote: I'm having problems populating an Excel spreadsheet using ADO.Net's OLEDB provider. The issue is that inserting strings with full stops in causes the next subsequent insert to fail. E.g. INSERT INTO [Template$A8:A8] VALUES ('This sentence has a full stop.') INSERT INTO [Template$A9:A9] VALUES ('This sentence does not have a full stop') Executing either one of these statements does not cause an error. Executing both in a row, causes an error to be reported at the location of the full stop (although it is then purported as being a # character). Closing the OLE DB Connection between the INSERTs does not resolve the issue - even if I rename the Excel spreadsheet and then reopen it. My code uses OleDbConnection and OleDbCommand objects to perform the inserts. Any ideas? |
#4
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.sdk
|
|||
|
|||
![]()
Whlist I haven't got any further, I've noted that the same problem also
occurs with #s. Is there any way of escaping #s or full-stops in strings in OLEDB insert statements? "keepitcool" wrote in message ... I think there's more efficient ways of populating Excel with ADO Erlandsen Data Consulting http://www.erlandsendata.no/english/vba/adodao/ keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Kevin Harrison" wrote: I'm having problems populating an Excel spreadsheet using ADO.Net's OLEDB provider. The issue is that inserting strings with full stops in causes the next subsequent insert to fail. E.g. INSERT INTO [Template$A8:A8] VALUES ('This sentence has a full stop.') INSERT INTO [Template$A9:A9] VALUES ('This sentence does not have a full stop') Executing either one of these statements does not cause an error. Executing both in a row, causes an error to be reported at the location of the full stop (although it is then purported as being a # character). Closing the OLE DB Connection between the INSERTs does not resolve the issue - even if I rename the Excel spreadsheet and then reopen it. My code uses OleDbConnection and OleDbCommand objects to perform the inserts. Any ideas? |
#5
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.sdk
|
|||
|
|||
![]()
Finally sorted my problem, had to specify the schema for ado.net explicitly,
and interrogate the datatable to extract the default column names, but I'm finally cooking with gas :D "Kevin Harrison" wrote in message ... Whlist I haven't got any further, I've noted that the same problem also occurs with #s. Is there any way of escaping #s or full-stops in strings in OLEDB insert statements? "keepitcool" wrote in message ... I think there's more efficient ways of populating Excel with ADO Erlandsen Data Consulting http://www.erlandsendata.no/english/vba/adodao/ keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Kevin Harrison" wrote: I'm having problems populating an Excel spreadsheet using ADO.Net's OLEDB provider. The issue is that inserting strings with full stops in causes the next subsequent insert to fail. E.g. INSERT INTO [Template$A8:A8] VALUES ('This sentence has a full stop.') INSERT INTO [Template$A9:A9] VALUES ('This sentence does not have a full stop') Executing either one of these statements does not cause an error. Executing both in a row, causes an error to be reported at the location of the full stop (although it is then purported as being a # character). Closing the OLE DB Connection between the INSERTs does not resolve the issue - even if I rename the Excel spreadsheet and then reopen it. My code uses OleDbConnection and OleDbCommand objects to perform the inserts. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Petty cash hell | Excel Discussion (Misc queries) | |||
Puzzled by statement about R1C1 style in "Escape from Excel Hell" | Excel Discussion (Misc queries) | |||
Pls tell me how in hell am I to ask a technical question in 4 wor | New Users to Excel | |||
Hyperlink hell | Excel Discussion (Misc queries) | |||
Need to Escape from Excel Forumla Hell! | Excel Worksheet Functions |