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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Doug Lindauer

    What is the correct or best approach in editing a table?

    This is a nice philosophical discussion. Actually in transaction tables I've created I HAVE included auto incrementing surrogate keys but I can never recall actually needing them. But you mentioned an updateable view and in that case it's 100% correct. You would need a unique key. I don't...
  2. Doug Lindauer

    What is the correct or best approach in editing a table?

    Absolutely correct Chriss. I didn't look closely enough at that. But, for me, I don't always create a surrogate key like an id number unless it must appear in a related table as a foreign key. It's fine but it seems like mostly an unnecessary addition. I can't argue with someone doing it as...
  3. Doug Lindauer

    What is the correct or best approach in editing a table?

    Mandy, I'm not sure you've gotten it yet. Let me focus just on what you said and wrote and give the simplest explanation. (Apologies to Chriss and mjc for rehashing what you've already said.) First off, you didn't give enough information for anyone to answer your question without making a lot...
  4. Doug Lindauer

    Sorting an array

    Kudos to costin77. He saw the problem while I was still trying to think about it. :) To add to his post, when you initialize an array, all the values are logical .f. so if you try to sort it when some values are character and some are logical it will obviously give an error.
  5. Doug Lindauer

    numeric equivalent of space() in select

    Well it comes down to whatever floats your boat I suppose. But for me, having been a dBase developer since about 1980 and having written stuff in various other languages and SQL implementations, I'm of the philosophy to keep your code as simple and direct as possible. That's because your code...
  6. Doug Lindauer

    numeric equivalent of space() in select

    Not sure why people want to complicate things with "cast". Simply put a 00.00 value in there as this: select CUSTNO , ; space(3) as TYPE , ; space(10) as BILL_STAT, ; 00.00 as NUMBS ; from TEST123 ; where RESTO='5103' You...
  7. Doug Lindauer

    Copy fields from one table to another

    Did you ever figure out the problem? BTW EinTerraner is certainly right that "append from ... for " is a solution. It's the simplest.
  8. Doug Lindauer

    Copy fields from one table to another

    Perhaps you're missing a key field in the detail table. Without seeing everything it's hard to know. Or maybe you have some filter on in the detail table?
  9. Doug Lindauer

    Copy fields from one table to another

    You have to put the "from" AFTER the field list as in : select *, ; , ; , from PASSAGEIROS where ... Note that doing this creates a new table TEMPPAX so if that's what you want, OK. It overwrites any existing TEMPPAX file. Also if you want to append the selected...
  10. Doug Lindauer

    Copy fields from one table to another

    If you do that you'll overwrite TableB with the structure from TableA and the contents will only be that of the select statement. You could either do an "append from" operation where you first copy the rows out of TableA into a temporary file and then append from the temporary file or Do a sql...
  11. Doug Lindauer

    Simple VFP App to reimplement in Android... anyone got any advice...

    This is what I did. My local community college has a lot courses in the computer area and I took 3 on developing in Java and Android. One of the projects I ported over to VFP was a blackjack simulation (the card game of blackjack.)
  12. Doug Lindauer

    What's the difference between scan for and scan while...?

    I was gonna answer but all these other guys kind of beat the answer to death already. :) I absolutely couldn't think of a thing to add!
  13. Doug Lindauer

    merge .txt in one named big.txt

    My bad, sorry. I usually pay attention to the VFP forum and those are visual foxpro functions.
  14. Doug Lindauer

    merge .txt in one named big.txt

    Use adir() to get an array of text files then filetostr() to read each one and add it to a string then strtofile() to write it back out as one file
  15. Doug Lindauer

    Concatenate 2 fields in 1 field with condition

    You didn't specify the data types and lengths of the fields. It looks like they're character type but the code will be a little different depending. In any case you'll be using either padl() or chrtran() somewhere in there along with "replace all ...". Keep in mind when posting a question like...
  16. Doug Lindauer

    Update data in a Cursor

    Mike, won't regenerating the cursor cause a problem with RecordSource of the grid? You've created a new object even if it has the same name. I've had problems when I've used the builder to create a grid and then change something even like a ControlSource for a column. It seems to blow up the...
  17. Doug Lindauer

    Selecting record from a Grid for use in another form

    1. yes it would be indexing the cursor but you didn't use the readwrite option and the way I found it works is that you can only make one tag index if the cursor is read only. I get an error when I try to do more than one unless I specify "readwrite". 2. Yes, it would just close the table, not...
  18. Doug Lindauer

    Selecting record from a Grid for use in another form

    I suppose the simplest way would be to create tag indexes when you create the cursor. (But apparently the cursor has to be readwrite.) You could even write one procedure that would work for any column by making the tag name the same as the field name. Then you can reference the...
  19. Doug Lindauer

    Selecting record from a Grid for use in another form

    Another way to do this is to just create a container on the same form. The container has all the controls for the details of the grid row. When you design, just have it down below the grid and invisible. When you click a row in the grid, the code makes the grid invisible (or move it down out...
  20. Doug Lindauer

    Accessing an android device from within VFP

    Exit command is nice. I put one in the loop in my code. It will only save a few microseconds but it's neater. I didn't want the user of the program to have to install anything on their device or go through any special steps so I didn't really consider using an FTP app. So far in my testing...

Part and Inventory Search

Back
Top