Greetings, Had several similar support calls (say that 3 times fast) this week related to the DataStation, so figured I'd send out an tip if you will.
The DataStation Open command has three parameters. (well actually 4 but the 4th is not applicable to this discussion) If one were to look at the "guts" of the DataStation Open command this is what you'd see. d.Open_(sFilename As String, [FileType As enumFileType = ftUnknown], [sConfigurationFile As String], [sMessage As String]) When you open a file in BWS, you fill in two of these: sFileName - the file you opened FileType - what kind of file it is (Excel, delimited etc.) So what about the third parameter - sConfigurationFile (the path and name of the configuration file btw)? That sounds important doesn't it J - a configuration file, usually a configuration file is something you need, without it, you have no configurations! Well, the [ ] in guts above actually means something, it means sConfigurationFile is optional. How can that be? Configurations typically are not optional. The reason it is optional is because when you opened the file in the DataStation, you actually created a configuration file, it is stored in the same directory as the file you opened and it is named after the file you opened + a .bds extension (good reason to NOT have hide known file type extensions set up in Windows Explorer but anyway). The DataStation has a brain. It's brain says - when a script executes the D.Open_ command, if you didn't tell it what configuration file to use, it looks to see if a configuration file already exists for the file it's opening based on the name of the file it is opening. If it does not see one, it will go ahead and create a new one - but this one will not have much in the way of configuration - only the file type and the datestamp on the file. So what are the morals of this story? 1. If your script will always open the exact same file - DO NOT DELETE THE .BDS FILE THAT ENDS UP IN THE DIRECTORY!!!!!! 2. If you (or others) can't resist going against moral #1, save the .BDS file to somewhere safe and specify it in the d.Open command - the third parameter Like everything else, there's more I could go into here like reports, handling files with different names etc. - but that's for another day. Happy scripting. Regards, Thom Thom C. Blackwell Product Manager Boston Software Systems (866) 653-5105 ex 807 www.bossoft.com <http://www.bossoft.com/> Sign up for my weekly webinar! <http://www.bostonworkstation.com/customer_center/special_events.aspx> LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately, then delete this message and empty from your trash. --- To post a message to this list, send mail to: [email protected] You are currently subscribed as: [email protected] Unsubscribe in the customer center on our website: http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx
