Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

MFC with AS400 backEnd.....

Posted on 2002-06-02
9
360 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Pressing cancel button with C# UI Automation 3 81
wait notify demo infinite loop 3 122
canBalance challenge 34 98
Excel file not created as expected 7 79
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

856 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