Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Import SQL Server query into a DBF
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01672529
Message ID:
01672534
Views:
48
Likes (1)
>>>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 && get data clipboard
lii=AT(CHR(13), lcData)
lcHeader=LEFT(lcData, lii) && get header - column list
lcData=SUBSTR(lcData, lii+1) && data
liColumns=OCCURS(CHR(9),lcHeader)+1 && column count
?liColumns
lilines=ALINES(xxa, lcData,0,CHR(9),CHR(13)) && convert string to array 1-dim
DIMENSION xxa(lilines/liColumns,liColumns) && redimension to 2-dim array
SET DATE YMD && date/date time is in XML format/121
APPEND FROM ARRAY xxa && cursor/tablr must exists with right structure
SET DATE german
BROWSE
MartinaJ
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform