Solved

MFC with AS400 backEnd.....

Posted on 2002-06-02
9
354 Views
Last Modified: 2013-11-20
Hi All,

I have a bunch of MBR files (say 20 with 20,000 records/page) in an AS400 server. These *.mbr files are generated every day by some other programs and are names XXX0224.mbr, with last 4 bits of file names as date.

These MBR files represent the data that I am supposed to work with. My client program is in VC++ and will reside in another server(windows ) from the data (AS400).

This VC++ /MFC client program is to work on AS400 server's data (mbr files) which somewhat look to me like text files on that system. ( I am new to AS400, never used it before). A lot of these files data are itself not in a standard format to make things worse.

Questions:
-----------------------
1) How do I attack this problem?
a)How do I connect to the AS400 mbr data files from a windows client (VC++/MFC).The window system I am developing on can see the AS400 server in the Network Neighbourhood.

I read some articles suggesting the use of third party drivers like Star ODBC, RUMBA  etc.

Where are these available to download and try out?

And say I am able to make an ODBC connectivity somehow , how do I connect to the dynamically changing files for each day.

I need As much info as possible, possible problems I may face and tips as possible.


Thanks a lot

--Niraj
















0
Comment
Question by:ghimireniraj
  • 4
  • 4
9 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 7055779
If you can see the server in Network neighborhood, can you also copy any of the MBR files to the local client?

Once you have a file that you can work with locally, you can open it and start processing the data.  Not much to go on... I've never heard of MBR files. But nobody else is looking into this for you.

-- Dan
0
 
LVL 1

Expert Comment

by:MN_Dave
ID: 7057217
I'm guessing that these files are in the IFS directory on the AS400.  If so, you can find out what folder these files are in and map to it from your local system (\\MyAs400\MyFolder). Once that is done, you can access it just like any file on your local pc.  A quick vb hack with the 400 folder mapped to drive "R" might look like:

Dim iBuff As Variant

Open "R:\abc0224.mbr" For Input As #1
Line Input #1, iBuff
Do While Not EOF(1)
Line Input #1, iBuff
Loop

Hope this helps.
0
 
LVL 3

Author Comment

by:ghimireniraj
ID: 7064597
Thank You Dan  and thanks Dave.

I could easily pull data from the As400 database with the use of the IBM client access driver.

If You would permit me I would wish to ask a different question in the same thread coz I am pretty sure you guys have come across this esp taking into consideration Dan's expertise.

I have to use a Sub form in a Database form.
I want to use Microsoft DataRepeater Control in VC ++. Please help me on How I can use it and display few buttons and text boxes in the repeater control. The data repeated in this control is the details tables data related to a main table whose data will be in the form holding this repeated control.

Precisely I want to do exactly similat to a contionous subform in a form in Access form.

I am porting an application previously written in access to VC++ AS400.

Thanks a lot.

--Niraj
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7064615
I've never seen the DataRepeater implemented in a VC++ program (on first sight, it looks rather complicated), but it has always intrigued me.  I'll look into it.

-- Dan

0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 49

Expert Comment

by:DanRollins
ID: 7064747
The problem with using the DataRepeater is that you must create an ActiveX control that contains several controls.  This is a non-trivial task in VC++.  Given that this seems to be a side issue, and given that I'm not certain that this is what you want, I'm not ready to commit to the effort just yet.

You may do well to think of another way to attack the problem.  A conversion of an Access program to a VC++ program does not necessarily mean that all screen U/I must the same -- as long as similar functionality is provided.  For instance, a CListCtrl a or DbGrid can be used to display database data with fewer complications.  Dialog controls can show the show -- and allow editing of -- the contents of any single record.

BTW.. if you are converting just for the speed enhancement of C++ over Access, consider that there won't be much.  The bottleneck will be in the access to the database, which will be similar in both cases.

-- Dan

P.S.  What about the original question?  Is that moot?
0
 
LVL 3

Author Comment

by:ghimireniraj
ID: 7065062
Yes Dan, For right now the original question is not a problem for me at least for now. The only problem I might face is to connect with different file names through ODBC coz I date.

Right now my problem is to figure out a way to show a master/detail table in a form.


I want to have a dialogbox / Record view which is displaying one record in the master table and and I want a sub form to show all the records in the detail table to show in a subform embedded in the master form realted to the current record in the master table.

I could have a MSflexgrid control to show those records but I need buttons and edit boxes in the detail portion to manipulate data.

Does something else easier soln run across you?


--Thanks

--Niraj
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 500 total points
ID: 7065172
Most often, the situation you describe is MAINLY about viewing the data and OCCASIONALLY about making manual changes to that data.

The common technique would be to show the grid and let users select any detail line.  Then provide a button or right-click handler that means "Edit this detail record"  Then popup a dialog that has the controls for editing.

Or, if there are only a few editable items, you can display those in controls on the same screen.  As the user selects lines in the grid, the matching data appears in the dialogbox controls for instant editing access.  You would do that in an OnSelChange-type handler.

-- Dan
0
 
LVL 3

Author Comment

by:ghimireniraj
ID: 7091726
Thanks Dan.. I guess I have to go that way.

What I have currently done is using a ADO data grid to list data and separate controls to add and edit the selected data.
But since my datagrid has data from multiple tables through select I can't delete just a part directly.

Give me some time.
Thanks

--Niraj
0
 
LVL 3

Author Comment

by:ghimireniraj
ID: 7219965
Thank You Guys!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now