1 Reply Latest reply on Apr 12, 2011 9:12 AM by philmodjunk

    Passing parameters or variables between two databases



      Passing parameters or variables between two databases


      I'm trying to create a new hires form, and I'd like to create a random password generator that will create a some-what easy to remember password upon a new record creation request. 

      I thought I would create a WORDS database, import 555 three letter words, upon import I auto generated a corresponding number between 100-655. Then in my HIRES database I wanted to create a couple of random numbers, goto the WORDS file and retrive the word that corresponded with the random numbers I had generated. 

      Sort of like, word1 = WordNumber1((Int(Random * 555)+100)), I'd do the same for word2, word2 = WordNumber2((Int(Random * 555)+100)). 

      Then I would put them together, and insert a 2 digit number between the two words. Password =  word1 & (Int(Random * 9)+10) & word2. The result would be something like - dog88tea.

      I'm fairly new at this and I can't seem to get my head around how to pass and get the information I need between the two databases. Or maybe I'm going about this all wrong.....Any help would be greatly appreciated.

        • 1. Re: Passing parameters or variables between two databases

          I'd use a relationship between your two tables (no real need for  a separate file, but you can still use a relationship).

          One trick is to use three fields, Key, cRandomSort, Word.

          Make cRandomSort a calculation field that computes a random number.

          After you create all your records in this file and load the word field with text, sort your records by the cRandomSort field (this randomizes the order of the words). Now use Replace Field Contents to load the Key field with a serial number value. If you start your serial number series with the same number as the next serial value of a serial number field in your Hires table, You can define a relationship between them so that the next new record in Hires links to the next random password in the password table. You can also just define a global field in Hires that you use as a counter with a relationship and script for pulling words from the word file. That script can pull together the next 2 words for your password and then increment the global field by two.