grant Posted May 13, 2001 Posted May 13, 2001 I have two files - one for players and the other for history (stats etc). I want to create a new record in the History when a new player is created in the player file. I'm not using a portal and don't want to. All I want is to copy the new name and the player ID into the History file. Should be easy but I can't manage it. I thought I could just copy it to the clipboard and it would paste in. Any ideas ?
Boomer231 Posted May 15, 2001 Posted May 15, 2001 I have a design that requires that data move routinely from one database to another. I have found that writing a script to import your players data into the "history" database can work very nicely. Make sure that you utilize a unique "matching field" in the import so you don't end up with a bunch of useless duplicate information. Making a relationship based upon each player after that to calculate averages and such should be cake after that.
grant Posted May 15, 2001 Author Posted May 15, 2001 I'm sorry, but I don't fully understand your answer. Do I do a find (in a script) that isolates the new record and just import that one record from the player file, adding it to the records that are already there ? Sorry to sound a bit thick ! Thanks
geod Posted May 15, 2001 Posted May 15, 2001 Grant, one of the most common ways to pass data between files is with a constant link. In each file create a caculated field that returns a number and give it a value of "1". Give your field a distinctive name like Constant or something that works for you. Create a relationship between the two files using the Constant fields. Make it a basic relationship, Do Not enable the options for deleting of related records or for creation of related records. Now you can use global fields in each DB to pass info between files. For instance in your problem, first create in the history file two global fields, one to hold the ID and another for the name. Then when your new record in players is created use a script to pass the info to the history DB using the constant relationship. Then when the script creates a new record in the history file use the Set Field command to set the ID and Name fields with the data from the globals. New Record/Request SetField "ID", "global_ID") SetField "Name", "global_Name") Hope that was clear enough to help.
grant Posted May 20, 2001 Author Posted May 20, 2001 geodd , thanks for that answer - it works beautifully. The only trouble I had was to copy the new file I had created. It always just took the first. I have a solution, but it probably could be better. Thanks again !
Newbies minneapolis Posted May 22, 2001 Newbies Posted May 22, 2001 quote: Originally posted by grant: I have two files - one for players and the other for history (stats etc). I want to create a new record in the History when a new player is created in the player file. I'm not using a portal and don't want to. All I want is to copy the new name and the player ID into the History file. Should be easy but I can't manage it. I thought I could just copy it to the clipboard and it would paste in. Any ideas ? Create 2 global fields into the the History file. "Name" and "ID". Create a first script in the player file which will define these two fields with these two informations. Create a second script which will start at the end of the previous one and will create a new record in the History file and will define the two text) (text) fields Name & ID with the values from the global.
Recommended Posts
This topic is 8591 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now