ODBC or ADO Question !

G

Guest

I have Microsoft Access 2003 with service pack 4 installed on my desktop
unit. I have an IBM Mainframe computer with DB/2 active on it. I have IBM
DB2 Content Manager Connect on my desktop unit as well.

I have multiple tables defined to DB2 and by using the following procedure
I'm able to connect to these tables with Microsoft Access.

Open Access application
Click on "File" on top tool bar
Click on Link Tables
Click on "My network Places" and select ODBC Databases at the "select files
of type" box.
Click on select Data source,
click on Machine Data Source
Select ICMLSDB whicl selected IBM DB2 Content Manager client supported DB2
files.
Locate my table names, then click on these names to add them to control of
Microsoft Acces.

This process establishes my connection to IBM Mainframe DB2 files. I do not
have any special code in my Access forms to open, close, read these files,
the connection seems invisible.

My real question is this. Should I be adding any additional code to my
forms for opening and viewing this data.

I have one problem where I have a form/subform used to display selected
query data. Data comes up in update mode of form, is viewable, but when I
attempt to add more records, I get an error of
"YOU CAN'T GO TO THE SPECIFIED RECORD".

Can anyone help with this error. Sample code can be provided if needed.

Thanks,
 
A

Albert D. Kallal

My real question is this. Should I be adding any additional code to my
forms for opening and viewing this data.

No, as a normal rule, there is no extra code required.
I have one problem where I have a form/subform used to display selected
query data. Data comes up in update mode of form, is viewable, but when I
attempt to add more records, I get an error of
"YOU CAN'T GO TO THE SPECIFIED RECORD".

Can you open up the master table, and add records via the table view? (in
other words, forget about the form..and try using the table direct).

And, the same question now applies to the child table. Can you open up that
table, and edit, and more importantly add records?
Can anyone help with this error. Sample code can be provided if needed.

It sounds like perhaps you don't have correct permissions to the database.
Or, perhaps you don't have the ability to create the correct key id's. Also,
if possible, you should expose the timestamp fields (if any) to all of your
forms/queries in ms-access that you use.

You also should likely take to the db admin of the IBM system, and ask about
how primary keys etc are setup. The problem could be as simple as ms-access
not knowing how to work with the primary keys used in the DB2 tables.

So, first, try editing those tables directly from ms-access via the table
view. Can you edit them? Next, if you can edit, and modify existing records,
then try adding a new record...can you add records? If you can't edit via a
table, then of couse trying to work with forms is going to be a waste of
time.
 
G

Guest

Albert,
Thanks for responding.

In response to yours. The Primary form named "Fr_CR_U" has a Record source
of DB2 Table TST_FR_CASE_RECORDS on the IBM Mainframe System. The sub-form
"sb_Fr_Add_Others_U" has a record source of "TST_FR_CASE_OTHERS" table on the
IBM Mainframe system. I have rights to the DB2 system with my user ID, and
have been able to successfully write records to these tables. The tables are
parent/child linked via two-part primary key CASE_NUM_YR and CASE_NUM. The
secondary table has additional index field of SEQ_NUM to keep records in
sequence (this field is autonum to the primary key field case) to keep these
records in sequence within primary key value. All works well in the first
process, a form asks user for case year and case #, this value is passed to
Fr_CR_U, SQL selects only these case records, and displays each and all
"Existing" records for that case. User can scroll forward and backward
through the data and modfiy "Existing records", it's when we try to "ADD NEW"
records, that we get an error. The form in ADD NEW RECORD mode reflects emty
form, allows entry of new data, but when processing (while in before insert)
or (after update insert) somewhere along the line, I get the error message as
stated in first part of my question. But, when you close the form, and
inspect the secondary table, (the table where the new record is to be added,
the record is there!).

Any thoughts,

I can send you the code behind the access form if you would like.

Thanks,

Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top