Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with SQL Pass Thru
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00948034
Message ID:
00948883
Views:
12
Tom...

Use the correct datatypes when its possible...
ldIniDate = DATE(2004,02,01)
ldEndDate = ldIniDate+1
SET TEXTMERGE ON
SET TEXTMERGE TO MEMVAR lcQuery NOSHOW
\SELECT Tally.ReworkNumber, Tally.Problem, 
\   TallyDetail.Kanban, TallyDetail.PartNumber, Tally.PartName,
\   Tally.SupplierName 						
\FROM Tally, TallyDetail 
\   WHERE Tally.ReworkNumber = TallyDetail.ReworkNumber
\           AND Tally.DateCreated BETWEEN ?ldIniDate AND ?ldEndDate  
SET TEXTMERGE TO
SET TEXTMERGE OFF

IF SQLExec(lnHandle,lcQuery,"cResult") < 0
   IF AERROR(laError) > 0
      Messagebox(laError[2])
    ENDIF
ENDIF
VFP automatically parses the variables using the "?" before the variable.

HTH

Mike;

>I receive a Connectivity error when I tried your suggestion, "Microsoft ODBC SQL Driver TRANSFORM is not a recgonized function name".

>At this point I have created dozens of examples of "how not to do it". :)

>Now I will have to get your code to work and will be upgrading to Visual FoxPro 8 as soon as management allows it. I have a dead line and do not feel good about it. Visual FoxPro 6 may not be the best tool for the job but your idea should help resolve that.

>Thank you.

>Tom


>Hi Thomas
>
>
>Local ldEndDate
>ldEndDate =  "09/22/2004"
>
>SQLEXEC(tConnection, 'SELECT Tally.ReworkNumber, Tally.Problem, ' + ;
>'TallyDetail.Kanban, TallyDetail.PartNumber, Tally.PartName,' + ;
> 'Tally.SupplierName ' + ;						
>'FROM Tally, TallyDetail ' + ;
>'WHERE Tally.ReworkNumber = TallyDetail.ReworkNumber ' + ;
>'AND Tally.DateCreated = ' + TRANSFORM(m.ldEndDate) ,'cuWeekly')
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Previous
Reply
Map
View

Click here to load this message in the networking platform