Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp6 with MS Sql server 7 SPT
Message
From
27/11/2003 10:32:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
27/11/2003 08:31:42
Suhas Hegde
Dental Surgeon
Sirsi, India
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00853955
Message ID:
00854023
Views:
16
>let me make myself more clear
>
>eg i have a local table and would like to fetch the results from another table on the sql server using one of the fields as the parameter.
>
>suhas

Suhas,
OpenRowset() - You already have the details, for others to benefit I'm writing the sample here too :)
Create Table myCountries (country c(10))
Insert into myCountries values ('USA')
Insert into myCountries values ('Germany')
Insert into myCountries values ('Canada')
use

lnHandle=SQLStringConnect('DRIVER=SQL Server;SERVER=servername;Trusted_connection=Yes')
SQLExec(lnHandle, ;
 "select * from Northwind.dbo.customers as rmtR"+;
 "   inner join OPENROWSET('VFPOLEDB.1', "+;
 "   '"+Sys(5)+Curdir()+"';'';'',"+;
 "   'select * from myCountries') as locR"+;
 "  on rmtR.country = locR.country",'myResult' )
SQLDisconnect(lnHandle)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform