Why Doesn't SQL Toolkit Accept a Table Name or Field Name with Spaces? Primary Software: LabWindows/CVI Add-ons>>Enterprise Connectivity ToolsetPrimary Software Version: 1.1 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I have a legacy database, and I need to access a table or a field name with spaces in it. For example, if the table name is "MyTable", I have no problem accessing it through the SQL Toolkit. However, if the table name is "My Table", I get an error -10. I could change the table names and remove the spaces, but is there a better workaround for this? Solution: The error -10 indicates that the error was not returned by the SQL toolkit, but it was returned by the underlying database provider. The SQL toolkit does not have any rules for table or field names with spaces. It is the underlying database provider that has a problem accepting the names with spaces. In general, it is a good practice to avoid table names with spaces, but sometimes you do not have a control over it, especially if you are using a legacy database. Most databases follow the ANSI SQL standard; for more information on the ANSI SQL standard, please visit JCC Consulting's SQL Std. Page (linked below). In order to use a table or field name with spaces, you can surround the entire name in brackets, like [My Name]. Related Links: JCC Consulting's SQL Std. Page Attachments:
Report Date: 05/16/2003 Last Updated: 12/07/2004 Document ID: 2XFF74SJ |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
