Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datetime fields in MSSQL as Date in VFP
Message
De
09/12/2009 11:10:09
 
 
À
07/12/2009 17:44:04
Hong Yew
People Quest
Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01437969
Message ID:
01438223
Vues:
37
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform