>I was using dot not exclamation sign.
Understandable, that's how T-SQL does it and some more. That's of course something a forum posting could have clarified very fast.
Yu can also skip the database name. As long as you only use one DBC, you OPEN DATABASE yourdatabase.dbc, it's opened and the current DBC, like USE sometable opens a table and opens it in the current workarea.And then you can USE tablename, even if the tablename differs from the file name, this won't need a DBF extension anyway.
Just to demo, what few people do, as it only complicates things:
Code:
Local lcDBC, lcDBF, lcTable
Cd (GetEnv("TEMP"))
&&random names
lcDBC = Sys(2015)+".dbc"
lcDBF = Sys(2015)+".dbf"
Create Database (lcDBC)
Create Table (lcDBF) Name dbcTable (iID I, cData C(50))
Use
Close Database
Open Database (lcDBC) Shared
Use dbcTable
? lcDBF
? Alias()
? Dbf()
Close Tables All
Close Databases All
This demos, the DBC stores a table name differing from the file name, if you want. You don't need to make use of the name clause of CREATE TABLE. And using the visual table designer also helps discovering all dbc table features, so I suggest you use the designer, and not CREATE TABLE for the start.
It's totally okay and less confusing, if you don't specify a name inside the dbc, then still you won't need to specify the dbf extension, but you also don't need to do that for free tables, VFP always extends a file name without extension with DBF.
And while I am always tending towards verbose and precise code, not specifying the database name makes it easier to adopt code with another customized to a customer DBC name, for example.
Bye, Olaf.