Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBC file name with spaces

Status
Not open for further replies.

chriscboy

Programmer
Apr 23, 2002
150
GB
I have got a trainee who I asked to create a database for me. The have called the dbc "IS Support Database.dbc". I have never been a fan on using spaces in filenames/fieldnames etc as I know it can sometimes cause problems.

Does anyone know if any problems with using spaces in dbc filenames, and I am being too picky about the space issue ?

Your comments please!
 
In theory, this is not a problem. As you probably know, you need to put quotes around the name whenever you reference it. If you do so, it should work fine.

However, there are places where problems could arise. One example is if you want to refer to the name via macro expansion, for example:

lcDBC = "IS Support Database"
....
....
OPEN DATABASE &lcDBC

In that case, VFP will see the first space as the end of the macro, and would generate a syntax error.

Obviously, it is easy to work round this sort of problem, but you do need to take care. It's better to change the DBC name so as to remove the spaces before you start writing code, if that's possible.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks Mike,

I think I will stick to not using spaces, its safer that way!

Cheers

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top