Templates, Tools and Utilities for Clarion Developers
|
|
|
|
Add a comment to an Icetips Article
Please add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
Par2: AS/400 connection on the web
2000-01-31 -- Steve Spierenburg
We've done it and when you know certain things, it's actualy quite easy.
You need 'Client Access' or 'Client Access Express'.
Be sure that the ODBC driver is installed, the other stuff is irrelevant.
And if you have the choice of the two, then install 'Client Access Express'.
It's smaller, more compact and quite quicker.
Then you need to set up a ODBC datasource.
Go to your control panel and find the icon with 'ODBC Data Sources (32bit)'
Activate Tab 'System DSN'
Click the 'Add' button
Choose 'Client Access ODBC Driver (32bit)'
Click 'Finish'
Name this DSN, something like your customers name. We use that because we
have several
AS400 customers, but you can do something else if you want. Relative
freedom.
For explanation purposes I'll call it 'STEVEN'
Make sure that the AS400 system is activated on the prompt 'AS400 system:'
Now activate Tab 'Server'
In the field 'Default libraries' you fill in the name of the Library that
has all the datafiles in it.
For instance: 'CBGDBF70,QGPL,'*USRLIBL'
CBGDBF70 is where all the datfiles are stored. 'QGPL' and '*USRLIBL', I
don't know, they never hurt me, so....
That's it for the DSN
Now go to Clarion
Load a dictionary
Choose 'Import file' from the 'File' menu
File driver is 'ODBC'
Activate Tab '32 Data Sources'
If all is well, the DSN name you chose should be there. You might want to
check
the 'Refresh tale list' checkbox if this is the first time.
Choose 'Next' button
On the Tab's 'Tables' and 'Views' you _should_ see all the files/tables you
would want to select/import.
IMPORTANT NOTE:
When Clarion imports the filedefinition, don't _ever_ count on it actualy
being correct, ok.
Check, check and check again. It might work for two weeks and then it hits a
record
where the string is actualy longer than the import definition
and...KABOEM!!!
Longs, shorts, bytes, one big mess. Check again, and again.
Also make sure that any keys are physicaly on the AS400. Otherwise Clarion
won't import
a definition for it.
To make it a little bit easier for yourself, do this:
Create global variables for Connecting to AS400, filenames and keynames
1) GLO:ODBCDataSource = to name the DSN you just created ('STEVEN')
2) GLO:ConnectString = to log onto the AS400
3) GLO:FileName_xxxxxx = to name the datafile inside the library
3) GLO:KeyName_xxxxxx = to name the keys inside the datafile
!GLO:ConnectString goes into the prompt 'Owner name' of the file properties
!GLO:FileName_xxxxxx goes into the prompt 'Full Pathname' of the file
properties
!GLO:KeyName_xxxxxx goes into the prompt 'Externale Name' on the tab
'Attributes' of the Key properties
Be sure the place a '!' infront of the variable when filling out the
prompts.
This instructs Clarion to use the variable as an variable instead of pure
text
ANOTHER IMPORTANT NOTE:
At least 1 (one) of the keys must be unique. Without it you cannot actualy
update the file.
Then at global startup of your application do something like this:
GLO:Library = 'CBGDBF70' ! Library name, remember from the DSN
definition?
GLO:LoginUser = 'MYACCOUNTNAME'
GLO:LoginPassword = 'SECRET!'
GLO:ODBCDataSource = 'STEVEN' ! DSN name, remember from the DSN
definition?
GLO:ConnectString = clip(GLO:ODBCDataSource) & ',' & clip(GLO:LoginUser)
& ',' & |
clip(GLO:LoginPassword)
GLO:FileName_CA0F = clip(GLO:Library) & '.CA0F' ! Would be
'CBGDBF70.CA0F'
GLO:FileName_SAMF = clip(GLO:Library) & '.SAMF'
GLO:KeyName_SAMFBI = clip(GLO:Library) & '.SAMFBI'
GLO:KeyName_SAMFIL = clip(GLO:Library) & '.SAMFIL'
GLO:FileName_SRLF = clip(GLO:Library_1) & '.SRLF'
GLO:KeyName_SRLFIL = clip(GLO:Library_1) & '.SRLFIL'
Well, this should get you on the way.
Today is December 3, 2024, 11:58 am This article has been viewed 35218 times.
Back to article list
Search Articles
Add Comment
Printer friendly
|
|
|