Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you use SET DATE over VFP ODBC driver
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Can you use SET DATE over VFP ODBC driver
Miscellaneous
Thread ID:
00455729
Message ID:
00455729
Views:
59
Is it possible to use SET DATE over VFP ODBC Driver?
I am trying to get a list of projects with their associated dates, in date order, from a projects table in Foxpro 2.6 format. The date field datatype is of Char format and cannot be changed to date type for particular reasons.

The problem relates to using DTOC() in the query (See code below). The resultant cursor contains blank or otherwise wrong date values which I'm sure are related to the DATE format/region environment variable. In interactive mode, I SET DATE to British and it solved the problem. Is it possible to use SET DATE over ODBC (The ODBC Docs don't mention that the ODBC driver supports SET DATE.)

ASP Code

SET objConn = Server.CreateObject("adodb.connection")
strConnection = "DSN=ERSData"
objConn.Open strConnection

strQuery = "SELECT CTOD(inbuild2) AS inbuild2, qty FROM project"
strQuery = strQuery & " ORDER BY 1"

objConn.Execute(strQuery)
Reply
Map
View

Click here to load this message in the networking platform