Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
$ operator in SQL server
Message
De
28/03/2005 05:41:03
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
27/03/2005 23:53:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00999360
Message ID:
00999383
Vues:
18
>Is there a way to use the $ operator with a CursorAdapter loading from MS SQL? I want to say:
>
>uniqid+'*' $ thisform.cString
>
>where thisform.cstring='1000*1002*1003*'
>
>UNIQID IN (?c1,?c2,?c3) won't work because the list of uniqid's may be 0 - 100's of uniqid's long.
>
>Thanks
>
>bonnie

Bonnie,
You can create an 'In' query like this:
cString = "1000*1001*1002*"

Create Table tempIDs (myId c(4))
ALines(aString,m.cString,.t.,'*')
Dimension aString[Alen(aString),1]
Insert into tempIds from array aString
use

Text to m.lcSQL textmerge noshow
Select * from myTable as remoteTable
 inner join
 OpenRowSet('VFPOLEDB','<<Sys(5)+Curdir()>>';'';'',
 'select myId from tempIds') as localTable
 On remoteTable.personId = localTable.myId
endtext

lnHandle=SQLStringConnect('DRIVER=SQL Server;SERVER=server;Trusted_connection=Yes')
SQLExec(lnHandle, "use myDatabase")
SQLExec(lnHandle, m.lcSQL,'myCursor')
SQLDisconnect(lnHandle)
Erase ('tempIDs.dbf')
Select myCursor
browse
Cetin




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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform