Support 805.461.7300
Sales
Our Technology. Your Success.

Add Database name to a field in your database

To create a field in your database, you can use the command:

ALTER TABLE (ALIAS()) ADD COLUMN filename C(20)

Add Column filename C(20) describes the name of the field (filename) the type of field (C for Character) and the width of the field (20 characters).
Then to add the database name to that field, use this command:

REPLACE ALL filename WITH SUBSTR(DBF(),RAT("\",DBF())+1)

DBF() is the complete path of your database. This takes everything from the first character right after the right-most backslash, which is the name of the database without any of the path, and puts it in to a field name called filename for every record in the list.
When you combine the two commands, you have a command that adds a field name then fills the database name into that field:

ALTER TABLE (ALIAS()) ADD COLUMN filename C(20) REPLACE ALL filename WITH SUBSTR(DBF(),RAT("\",DBF())+1)

« Back to Commands

We have over 200 vendors we work with on a daily basis and (the AccuZIP6 techs) are the most knowledgable, helpful group of folks I have worked with, always willing to go out of the way to help. As owner and GM of a Print and Mail Shop I admire the dedication these folks have in making sure we are satisfied. I also appreciate the fact that a human answers the phone.
M.S., Mt. Vernon, IL