INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Jobs from Indeed

PowerCOBOL with ADO Connection - write the first record in the table

PowerCOBOL with ADO Connection - write the first record in the table

PowerCOBOL with ADO Connection - write the first record in the table

(OP)
Hi,

I use PowerCOBOL v10.
I did a project using ADO datasource control to connect to an MS SQL table that this empty table does not contain any record.
I will write the first record in the table
I use addnew method

INVOKE "Recordset" OF CmADODataSource1 "AddNew"

INVOKE tnum_func "UpdateRecord"
INVOKE tnome_func "UpdateRecord"
INVOKE "Recordset" OF CmADODataSource1 "Update"



but not recording the first record in the table
shows error message that recordset is empty
a friend can show how to record the first record in the table
thank you

Paulo

RE: PowerCOBOL with ADO Connection - write the first record in the table

(OP)
Hi Frederico,

This is error message when INVOKE "Recordset" OF CmADODataSource1 "Update"
command is executed

Message is
an empty line can not be inserted
The line should have at least one defined value column.


Remember my this empty table, no records exist engraved on it.
this is the first record that I will write to the table.





Regards

Paulo

RE: PowerCOBOL with ADO Connection - write the first record in the table

I did ask for full source - where is the source for tnum_func and tnome_func? where is CmADODataSource1 defined and how is it defined?

and error is quite clear - the fields of the recordset are empty which means that the 2 functions you call between the AddNew and the Update did not do anything or did something that wasn't what you expected.

Assuming that your recordset contains the fields I see mentioned on your sample code are the fields of that recordset try the following

copy the 3 lines where you do a move of source, state and status to umsg and display each of the values to a line between the "invoke tnome_func .." and the "invoke recordset ... Update". I expect they will be empty as per the error message.

As a standard I would also advise you to explicitly define a recordset object and work with it instead of using the default(current) recordset of a connection.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: PowerCOBOL with ADO Connection - write the first record in the table

that's no good for me - at the moment I don't have powercobol available and the ppj in any case contains copybooks that weren't supplied.

so as you have to invoke statements with a updaterecord method give us the full source of those - copy and paste into notepad and only then put here as text.

and have you tried what I said?

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close