Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CA connecting to table with space in name
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01485210
Message ID:
01485427
Views:
39
>>>>I am connecting to a SQL server table with a space in the table name (say, [my table]) via a CursorAdapter. How should I write the UpdateNameList property of the CursorAdapter.
>>>>
>>>>I tried quoting the table name with a pair of square brackets like "id [my table].id, num [may table].num". However the CursorAdapter failed to update the master table with the changes in the cursor.
>>>>
>>>>Any idea?
>>>
>>>I think here you should use the name of the cursor, not the table. Did you try that? Also, perhaps it's not too late to rename this table and remove the space?
>>>
>>>Read this blog post
>>>Do not use spaces or other invalid characters in your column names
>>
>>I disagree with that post. Why would aesthetics or the perceived difficulty in reading/understanding be a factor whether to use a feature or not? What if I like to use the brackets for I like them and makes easier for ME understanding and reading the code.
>
>Hi Hugo,
>
>I suggest to add comments to this blog directly, although I can also invite the author (recently named SQL Server MVP) to defend this position here.
>
>So, do you use spaces in the field names in SQL Server columns? How do you work in VFP with columns that have spaces?

No, I do not use spaces nor do I use special characters, I often do not use brackets either, but as I said I do not believe aesthetics or personal preferences should be considered as best practices either, as, at least for the reasons given in the post, there is nothing intrinsically wrong if someone likes to use spaces, brackets and the whole enchilada, we may not like it, but is not our code either.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform