Save application settings in vb6 - vb6

I wanted someone to help me decide which is the best option to save the settings of an application on vb6. I understand that this can be done with an INI file and/or modifying the registry. I need you to move the directory if one computer to another, the application stops working.
What you think is the best option?
If someone has an interesting link that can help me thank you very much!
Thank you for readme and sorry for my English!

We don't use the registry but follow these steps which has worked well for us even when crossing platforms and new versions of a language:
Save all parameters in a table in a database associated with the application. We normally call this "Code" with the fields "Type", "Code", "Description", and "Control". For example, the name of the company would be stored in the table as "PARM","CONAME","My Company Name","". If you have a dynamic list of transaction types, store them as "TRNS","01","My 1st Type","" and "TRNS", "02", "My 2nd Type", "" and so forth. The Control field is used for anything you want that's hidden from the user but possibly controls how the program responds based upon the users selection of that type...as an example. To get the list of types, just use a SELECT statement like "SELECT * FROM [Code] WHERE [Type]='TRNS' ORDER BY [Code];".
Save the connection to the database in an encrypted ini file. We wrote the encryption and decryption functions ourselves. There are various out of the box ways to do this on various blogs.
Installing the application on another system demands access to the database and copying the ini file.

Related

Limit access to an Excel file database

I'm using some Excel files like databases.
Those files are read by a VBA code that extract data from it.
For example I've created an Excel file containing logins and password to build an authentification system.
What I would like to do now is to limit access to those files so that only my code can access/modify them.
Safeguards:
Hide the window when reading, at the end of the sub close the workbook.
Password protect the workbook, its VBE with a separate password.
Password protect the sub that calls the workbook (containing the password as plain text).
Events to every possible occasion to close the workbook if accessed manually.
If someone only needs to read it, a query can be set up on the fly then disconnected ASAP.
Make sure you double- and triplecheck whether you can use alternatives, Excel is not safe.
Instead of using Excel to store passwords, you can test who is currently logged in to windows via curr_user=Environ("USERNAME") in VBA.
This pushes the authentication to Windows and you don't have to store passwords. Then you just need to look up the curr_user on a list of authorized users, which is better than storing a list of users and passwords. #user3819867 's suggestions would still apply to this 'user list', just as it would to a 'user and password' list.
Only trade-off is that you couldn't run the Excel database on someone else's computer, but that might be a reasonable compromise compared to the alternative.

How do I run/call/kickoff an external program (custom code) whenever certain attributes or objects are added or modified in OpenDJ’s database?

How do I run/call/kickoff an external program (custom code) whenever certain attributes or objects are added or modified in OpenDJ’s database?
Here is my real world need. (Feel free to change my thought direction entirely).
Whenever a new email address gets created or changed in the OpenDJ database I want to initiate some java code that does some email verification/validation (send the “click here” link with a token to prove the user owns the email they just signed up with).
I know, I could use OpenIDM/AM to accomplish this but to take this a step further I need to validate other information and other credentials (custom) which users supply that are not supported by OpenIDM/AM suites.
Initiating/calling custom code upon ADD or MODIFY of specific objects and attributes is what I want and would like to know how to accomplish this. Preferably without having to scrape logs.
Please Help.
Chad
OpenDJ has a plugin interface where you can plug Java calls on Add or Modify. A sample of this kind of plugin is the attribute uniqueness which verifies that some attributes have a unique value in the directory.
The plugin interface javadoc can be found here : http://docs.forgerock.org/en/opendj/2.6.0/javadoc/org/opends/server/api/plugin/DirectoryServerPlugin.html

How can I work with Windows security groups without knowing their localized names in advance?

I've searched around online but can't find what I'm after. Basically, during an install, we fire off a separate executable that basically brute forces a few folders to be read/write enabled for the user group "EVERYONE".
Now, the person that wrote this never took into consideration system language. I had a call with a customer in France that kept failing installation because "EVERYONE" isn't what we would expect.
I'm after an API call to Windows that would return a security group name which would be "safe" to use in a localized environment. Essentially I'm looking to safely edit this code so instead of hardcoding in "EVERYONE", we call a function instead.
The fundamental mistake here is not so much the use of EVERYONE, but rather that the code is using names at all. Instead of using names you should use the well-known SIDs. In your case you need S-1-1-0.

How to use internationalization in Label fields in Screens in Oracle Policy Automation

I am very new to Oracle Policy Automation. I am developing a screen which will give the option to the user to select languages. Based on his/her selection, the next screen should display a welcome message in the language selected.
I have two properties files (one for each language) and I have placed them inside the /classes/configuration folder.
Now, my query is how to invoke these properties files based on user selection and what should I write in the label field so that the messages are dynamically picked up.
Thanks in advance for the help.
I guess you may have figured this out by now.
In OPA the locale has to be set at the start of an interactive session (part of the start investigation URL) and cannot be changed subsequently. The locale specific resource files under configuration will then be used.
Your locale selection screen would probably need to be outside of OPA triggering a session start of the correct type. If you are using OWD then it will actually provide it's own locale selection screen if you try to access a rulebase without specifying the locale to use. We are working on some additional tooling around OWD to make this process a lot more straightforward

Programatically retrieve an attachment stored on a note on a CRM 4.0 entity

How would you suggest working with files that is stored on the note of a entity in Crm. Could you write a generic method that will enable you to access any type of file? Or would it be better to have a method for dealing with each type of file?
For example, we are going to be saving a mix of swf files and xml files on the entity, so would it make sense to have a method each for example:
GetXmlFilesOnAccount(accountid)
GetSwfFilesOnAccount(accountid)
When you upload an attachment to CRM the mimetype is also saved as part of the record information.
The following link contains a nice example of how to download the attachemt using a single method. http://crmscape.blogspot.com/2009/10/ms-crm-40-sending-attachments-to.html
The post is missing the actual query needed to retrieve the annotations but you can tell what columns are required from the method signature.
My suggestion using your methods:
* GetXmlFilesOnAccount(accountid)
* GetSwfFilesOnAccount(accountid)
Retrieve account activitypointers by regardingobjectid(in your case accountid guid)
Loop through returned activitypointers
Get attachments for each activitypointer (activitypointer.activityid = activitymimeattachment.activityid)
Store attachments (disk, etc)
You don't even need two methods. You can retrieve all attachment file types for a given note (annotation) with a single method.
Hope this helps.
I recently started an Open Source Project on CodePlex to accomplish exactly that. Feel free to check out the Project's Web Page at:
http://crmattachdownload.codeplex.com/
You can also view the source code under the "Source Code" tab of that same page.
Pete

Resources