Memo field is not Evaluating in Listbox

Ransford Graham 1 Reputation point
2021-04-15T14:40:55.617+00:00

SQL Server/Visual FoxPro Application

How do I get the comments field to evaluate as a string in the routine below:

lnMarketid = 0

lnReturn = SQLEXEC(oGv.pnConnhandle, 'EXEC MCRevenue.Sundries.RetrieveMarketRevenueBankTransactionsSP ?lnMarketid','bankingtransactions')
IF lnReturn = -1
=odbcerror() && Log the error
RETURN .F.
ENDIF

The 'comments' field in the table is 255 characters

ThisForm.lstSelection.RowSource = "bankingtransactions.market,bank,branchname,transactiondate,transactionamount,datelodged,marketid,routerid,lodgementid,comments"

'comments' is the memo field which evaluates to "memo" - I want to translate memo to a string

lcComments = ThisForm.lstSelection.List(lnCnt,10) && evaluates to "memo"
IF TYPE( lcComments ) = "M" && but here the Type is not "M" (memo) so it jumps out of the routine
lnLines = ALINES( laLines, lcComments, 1 )
lcComments = ""
FOR lnLCount = 1 TO lnLines
lcComments = lcComments + laLines[ lnLCount ] + CHR(13) + CHR(10)
NEXT
ENDIF

SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. CarrinWu-MSFT 6,891 Reputation points
    2021-04-16T03:21:58.513+00:00

    Hi @Ransford Graham ,

    Welcome to Microsoft Q&A!

    You question is related to Visual FoxPro, and FoxPro Forum has migrated to Microsoft Q&A. You can find all products that supported on Q&A forum from this link, and here is Tag List. But it seems that FoxPro tag still not be created, please refer to this link. I suggest you that please post your question in here.

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Naomi Nosonovsky 8,431 Reputation points
    2021-04-16T16:18:27.477+00:00

    Instead of using fields as the source type for the dropdown, can you use select statement and use cast(myMemo as char(254)) as Comments as part of the select.

    Also, if you want to get help with Visual FoxPro question I suggest to use www.LevelExtreme.com forum where you can still find active VFP developers.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.