>>>>Hi,
>>>>
>>>>When you run a SQL Select in SSMS and see the query, you can Select All and Copy with Header or Without Headers.
>>>>But then, if you paste this "report" into a Word or Notepad, you can't really see the records easily.
>>>>
>>>>Has anybody created a code that would import this copy of the SQL Server query into a DBF?
>>>>
>>>>TIA
>>>
>>>That's easy enough. Just make a variable which holds the very same query. Then when you SQLExec() this query, you end up with a DBF which you can Copy to a DBF.
>>
>>The problem is that I am running this query in the SSMS (remotely connected to the custom site). So, I cannot use VFP SQLExec(). But I can run the SQL Select and copy the query.
>>Thank you.
>
>Hi Dmitry,
>
>
>lcData=_cliptext
>lii=AT(CHR(13), lcData)
>lcHeader=LEFT(lcData, lii)
>lcData=SUBSTR(lcData, lii+1)
>liColumns=OCCURS(CHR(9),lcHeader)+1
>?liColumns
>lilines=ALINES(xxa, lcData,0,CHR(9),CHR(13))
>DIMENSION xxa(lilines/liColumns,liColumns)
>SET DATE YMD
>APPEND FROM ARRAY xxa
>SET DATE german
>BROWSE
>
>
>MartinaJ
Thank you, Martina. I am having a little problem with your code. But it is probably me not your code.
UPDATE. I found what I was missing in your code. I have to create the cursor first. Again, thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham