Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datetime fields in MSSQL as Date in VFP
Message
From
09/12/2009 11:10:09
 
 
To
07/12/2009 17:44:04
Hong Yew
People Quest
Malaysia
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01437969
Message ID:
01438223
Views:
35
Hi,

the FLL @ www.vfp2c.com has a replacement function for SQLEXEC called SQLEXECEX which accepts a cursorschema description in one parameter ...

in the file "odbc.prg" in the example project (contained in the vfp2cexamples subfolder) there are codesamples on how to use it ...

e.g.
#INCLUDE vfp2c.h
SET LIBRARY TO vfp2c32.fll ADDITIVE
INITVFP2C32(VFP2C_INIT_ODBC)

&& assuming lnCon is a valid connection handle ...
lnRet = SQLEXECEX(lnCon,'SELECT someCol, someCol2, someDateTime FROM yourTable', 'cCursorName', '', 0, 'someDateTime D NULL')
IF lnRet = -1
 AERROREX('laError')
 DISPLAY MEMORY LIKE laError
ENDIF
If you're using an older VFP version the only other solution is defining a "view" in a DBC where you can also specify the datatype.
In VFP9 you can alter the datatype by specifying the cursorschema property in the CursorAdapter class.

Regards
Christian
Previous
Reply
Map
View

Click here to load this message in the networking platform