Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql fields with spaces in column name
Message
 
To
29/12/2008 14:01:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01369972
Message ID:
01369975
Views:
8
This message has been marked as the solution to the initial question of the thread.
>Hello,
>
>I'm trying to interface to Sage's ACT!. Yeah, woe is me.
>
>Anyways. There are some fields in there that look like: CONTACT OPPORTUNITY CONTACTID
>
>Obviously, this confuses me, but I figured I'd try to SQL it anyways with ADO.
>
>cSQL = [select * from VRP_CONTACT where CONTACT CONTACTID = "] + crsrs.contact_opportunity_contactid + ["]
>
>This confuses ADO too, so I'm not alone.
>
>I tried using just contactid and contact_contactid.
>
>Nothing seems to go. Any ideas?

If that is using standard SQL Server syntax, then you should be using something like..

cSQL = "select * from VRP_CONTACT where [CONTACT CONTACTID] = '" + crsrs.contact_opportunity_contactid + """

Brackets around identifiers are SQL Server's way of handling illegal names.
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform