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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

puzzle getting memo contents

Status
Not open for further replies.

coldan

Programmer
Oct 19, 2008
98
AU
I have some code in my app that works well to get memo contents into a csv file.

I create a table including LEFT(Descript,255)As Desc,; in the select statement.

I am trying to do a live test to check some data and I cannot get the above line to work - I get a ltablerror = .t.


this code works OK

Select idexhibit As Exh_Num;
From john_i;
INTO Array amycursor1

this code gives that error

lTableError = .F.
Select idexhibit As Exh_Num,;
zname As Topic ,;
LEFT(Descript,255)As Desc,;
id_person As IMG_No;
FROM john_i;
INTO Array amycursor1

It does not form an array.

I can't see the wood form the trees - can anyone see the problem please?

Coldan
 
Coldan,

You say lTableError is getting set. I can't see anything in your code that's doing that. Are you doing it in an error-handler or error event (for example, do you have ON ERROR lTableError = .T. in your code)?

If so, then any error would cause it - not necessarily one related to the memo field. You need to display the error number or message to find the cause.

You also mentioned that the array was not being created. That would happen because of the error. It could also happen if there was no error but the result set was empty. Is it possible that you are testing with an empty copy of John_i?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike,

I agree the code looks right - that's the mystery.

I can browse the table before these lines in the debugger.

I only posted an extract of the full prg which has ON ERROR etc

I get a result with the select if I remove the LEFT statement but the field IS there.

Puzzling!

Coldan
 
Coldan,

The best thing to do is to remove the ON ERROR temporarily. Then run the program. When you do, VFP will display an error message indicating the nature of the error.

That should give you a head start.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
After the SQL executes check the return value from the message() function. This function will contain the text of the last error that foxpro encountered. check it and it may help you determine the cause of your problem.
 
One other thought. I doubt that it's the problem, but try giving the new field a name that isn't a VFP keyword. DESC is.

Tamar
 
Sadly, none of these solved the problem.

I put a Brow after the _I file select and saw all the info in Memos.

The message() after the SQL was Memo file for john_i.fpt is missing or invalid.

Having just browsed this is nonsense? Yes?

Coldan
 
Having just browsed this is nonsense? Yes?

Not necessarily. It's possible that the memo file is corrupted, but that the corruption didn't manifest itself in your browse.

Take a look at faq184-5641. It describes a similar problem and suggests a possible solution.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top