Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run sql server stored procedure from VFP
Message
From
14/09/2017 05:10:02
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012 R2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01654272
Message ID:
01654280
Views:
62
Hello again Naomi,

I see an example doing this:
		ConnString = "DRIVER=SQL Server;SERVER=[Server Name];UID=;PWD=;DATABASE=[Database Name]"

		Handle = SQLSTRINGCONNECT(ConnString)


		SQLEXEC(Handle, 'm.Query', 'cResults')
Also, for trying them i need to know how to create a variable for saving to m.Query my SELECT Statment above :
'  SELECT
ft.no[Entidade], ft.nome[Nome Utente],f.telefone [Contacto], ft.etotal [Valor 1], Rtrim(f.refmb1)+SPACE(1)+RTRIM(f.refmb2)+SPACE(1)+RTRIM(f.refmb3) [Ref. MB 1],
(CASE WHEN SUBSTRING(area,1,1 ) = ''C'' THEN ''C''+ substring(CAST(ft.ftano AS VARCHAR),3,2)
WHEN SUBSTRING(area,1,1 ) = ''H'' THEN ''H''+ substring(CAST(ft.ftano AS VARCHAR),3,2)
WHEN SUBSTRING(area,1,1 ) = ''G'' THEN ''G''+ substring(CAST(ft.ftano AS VARCHAR),3,2)
WHEN SUBSTRING(area,1,1 ) = ''A'' THEN ''A''+ substring(CAST(ft.ftano AS VARCHAR),3,2)
ELSE '''' END) [Amostra]
FROM ft (nolock)
LEFT JOIN (SELECT no , tlmvl FROM cl ) c ON c.no = ft.no
CROSS JOIN ft2 f
WHERE  f.ft2stamp = ft.ftstamp 
and ft.ftstamp in (''ADM17091248603,063611992'', ''ADM17091345139,503834522'')  '
Thanks again,
Luis
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform