![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I'm wondering if someone can help me with a problem I'm having. I'm not a programmer, but I wrote a program in Foxpro 8.0. This programs uses a few tables. The problem I'm having is that I have one main table, I call it "&mid." The name of this table changes everyday, I need to create and save a new table everyday for my program to work right. What I do is use today's date and a number and store that in, 'mid.' When I want to read or write to that table I reference it by using "&mid.," example. "SELECT Time FROM &mid." I have no problem reading and writing to '&mid,' but if I open one of the other tables and read and write to them, then try to read and write to, '&mid' again, I get an error saying Variable rank (this is the name of the field) not found. What I do is a take some information from my other tables, do some work on the data and try to put the new data in a field called,'rank', in table, '&mid.' I use the replace command (tried using insert command but that didn't work), " replace rank with XYZ(an element in a array)." I tried using, "Replace &mid.rank with xyz" but I get an error message, "Command contains unrecognized phrase/ keyword." I tried using the use command, 'Use &mid' but I get back an error saying, "file is use." I also tried, "Use &mid in 0 (tried all the way up to 10)," same error message. I tried using the open command, "Open database &mid in 0" (Also tried all the way up to 10 and tried use, Open &mid in 0), I get, "Command contains unrecognized phrase/keyword." I tried using, "Select &mid in 0" and again get "Command contains unrecognized phrase/keyword." If I don't open the other tables and just assign a value to, 'XYZ,' and use, "replace rank with XYZ," I have no error messages and it puts it right in rank. Any helpful ideas? |
#3
| |||
| |||
|
|
do this: use "&mid" alias MyData then use mydata instead of "&mid." replace MyData.rank with xyz select time from mydata avoid using macro expansion at all costs... |
#4
| |||
| |||
|
|
Hi, I'm wondering if someone can help me with a problem I'm having. I'm not a programmer, but I wrote a program in Foxpro 8.0. This programs uses a few tables. The problem I'm having is that I have one main table, I call it "&mid." The name of this table changes everyday, I need to create and save a new table everyday for my program to work right. What I do is use today's date and a number and store that in, 'mid.' When I want to read or write to that table I reference it by using "&mid.," example. "SELECT Time FROM &mid." I have no problem reading and writing to '&mid,' but if I open one of the other tables and read and write to them, then try to read and write to, '&mid' again, I get an error saying Variable rank (this is the name of the field) not found. What I do is a take some information from my other tables, do some work on the data and try to put the new data in a field called,'rank', in table, '&mid.' I use the replace command (tried using insert command but that didn't work), " replace rank with XYZ(an element in a array)." I tried using, "Replace &mid.rank with xyz" but I get an error message, "Command contains unrecognized phrase/ keyword." I tried using the use command, 'Use &mid' but I get back an error saying, "file is use." I also tried, "Use &mid in 0 (tried all the way up to 10)," same error message. I tried using the open command, "Open database &mid in 0" (Also tried all the way up to 10 and tried use, Open &mid in 0), I get, "Command contains unrecognized phrase/keyword." I tried using, "Select &mid in 0" and again get "Command contains unrecognized phrase/keyword." If I don't open the other tables and just assign a value to, 'XYZ,' and use, "replace rank with XYZ," I have no error messages and it puts it right in rank. Any helpful ideas? |
#5
| |||
| |||
|
|
Josh Assing do this: use "&mid" alias MyData then use mydata instead of "&mid." replace MyData.rank with xyz select time from mydata avoid using macro expansion at all costs... JPGREEN Thanks for answering, I tried what you wrote like this USE &mid ALIAS Mydata replace Mydata.rank WITH ranka replace Mydata.rank2 WITH ranka2[sam2,3] I also tried, USE "&mid" ALIAS Mydata, as you wrote is, both cases it came back, "file in use" |
![]() |
| Thread Tools | |
| Display Modes | |
| |