VBA SQL won't run because of custom field name

A

anovak

I've got the following SQL statement that won't execute in a VBA
script because the custom field referenced by the view is "Service
Area", not "Service_Area" or "ServiceArea" (there is a space in
between)


rs2.Open "Select MemberValue FROM 'MSPLT_Service Area_UserView' ORDER
BY MemberValue", Conn

Anyway I can cod this to "excuse" the space or do I have to rename the
custom field to "Service_Area" or "ServiceArea"?

Thanks,
Andy Novak
UNT
 
M

Marc Soester [MVP]

Hi Andy, may be worth posting to the development group. You may be more lucky
with an answer
 
R

Ray McCoppin

In SQL you can use square brackets "[]" to enclose any names of tables,
fields that have should problems. So the syntax for you query would be like
this:

..... FROM [MSPLT_Service Area_UserView] .....

Hope this helps

--
Ray McCoppin

http://www.randsmanagement.com
SRS gantt charts
Project Server 2007 Archive tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top