Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cursor -vs- Table

Status
Not open for further replies.

MyNeckHurts

Programmer
Apr 5, 2002
34
US
In version VFP 6.0 I was able to rename, add, and drop columns of cursors. It doesn't seem to work in VFP 7.0. I use the cursor data in exported excel files. Does anyone have any suggestions?

Sample:
ALTER TABLE tmpPayments DROP COLUMN acctg_dt
ALTER TABLE tmpPayments RENAME COLUMN Idate TO Invoice_Dt
 
Hi
I dont know why it is not working for you. It works in VFP7 also :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
From what I can tell Alter table does work on a table but not a cursor.
 
Hi

CREATE TABLE test (test C(10))
ALTER TABLE test RENAME COLUMN test TO field1
BROWSE

This will work.
HOwever, if you are creating a read only cursor and wanting to change the field, it will not. It is becaiuse, the cursor is read only.

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
MyNeckHurts,
That simply isn't true. As Ramani says, it works fine in VFP 7.0. You are speaking of a cursor your created with CREATE CURSOR ... right? If it's a cursor you created from a SQL Select then yes you can't alter it even if you use the READWRITE clause.

Rick
 
I can create a cursor and alter it from my command line but not in my complied app or exe using 7.0.

The cursor is created with create cursor from array:
Code:
 create cursor (tcCursorName) from array laField

The error is 1115 and states invalid operation for the cursor. Error 1115 says I'm trying to pack the cursor, this is what I'm actually doing:
Code:
  ALTER TABLE tmpcsrlist ADD COLUMN TDate D
  ALTER TABLE tmpcsrlist RENAME COLUMN cntrct_id TO contract

I'm not crazy guys this is happening and it started after I upgraded to 7.0 sp1. I tried to step through the code and even opened the cursor and changed some data and it worked. But within my application when the command to alter it fires it boms. Thanks for trying to help.
 
Just to let everyone know there is an issue between VFP 6.0 and VFP 7.0 when it comes to altering cursors. In my case a cursor is created in VFP from an ORACLE table structure. ORACLE allows up to 30 character field names, VFP 10 characters. VFP 6.0 allowed me to alter a cursor that did not adhere to the 10 character field name limitation and without an error would truncate the field names to 10 characters. With VFP 7.0 prior to the alter statement it will pack the table, if the table has fields with more than ten characters it will display the error 1115. I have spoken with Microsoft about the issue and they are looking into it.
 
Good catch! I never thought to check out that particular scenario. Often it's difficult to find these irregularities because there are just so many possibilities!

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top