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

Link (ODBC) table to table frame in setup form at runtime

Status
Not open for further replies.

kimenemark

Programmer
Nov 14, 2002
14
DK
Hi,

I have a main form with lots of fields from lots of tables arranged so that the user can get a fast overview of all the info.
In order to get it all in a 800x600 pixel view I have used 3 notebook objects with 3, 4 and 10 tabs (as I said, a lot of info).
2 of the tabs in the 4-tab notebook containes 2 tableframes based on ODBC linked tables from a (known) accounting program.
However I don't know what type of accounting program the user might choose but if I included a setup-form where the (super)-user could link the ODBC alias to the tableframes selecting the desired fields it would solve my problem.
The data shown in the tableframe is read-only but NOT static.
Is this at all possible and if so would it be possible in a Delivered app.??

Regards
Kim
 
Kim,

It is possible. Simply provide a runtime interface that lets the user define the alias pointing to your ODBC datasource at Runtime and then use addProjectAlias() to define it, as opposed to addAlias(). (Project aliases exist only while Paradox is running.)

You'd then use a configuration file (such as an INI file) or Registry entry to determine whether or not the data source has been defined. If so, then add the project alias when your applications starts up; otherwise, prompt the user to define the ODBC setting.

Now, I don't know of anything that already exists for this, however, it shouldn't take too much to determine the settings you need to define the alias--especially once you've gotten working once. (Mind you, this may take some time and will likely depend on the version of MDAC installed on the end user's machine.)

Be aware that you will probably need to have the superuser use the ODBC Administrator to create a DNS before you'll be able to define the alias. You can launch the ODBC Administrator from ObjectPAL with the following code:

Code:
method pushButton(var eventInfo Event)

   execute( "rundll32.exe shell32.dll," +
            "Control_RunDLL odbccp32.cpl" )

endMethod

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top