Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I talk to Access?
Message
From
12/08/2003 05:51:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/08/2003 04:36:01
Edward Crawford
City Facilities Management
Glasgow, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00818921
Message ID:
00819283
Views:
19
>I think the problem is that Access does not recognise the TTOD() function. The event_date_time Access field is a datetime field, but I want to extract all records for a specific date. So when I use
>
>CREATE SQL VIEW Temp_Agent_details CONNECTION arcview AS ;
>SELECT *;
> FROM Agent_details_001 ;
> WHERE TTOD(Agent_details_001.event_date_time) = DTOC("06/06/2003")
>
>and Use Temp_agent_details I get the error ODBC Connectivity Error undefined function TTOD in expression. If I use REQUERY("Temp_agent_details") or REQUERY("arc!Temp_agent_details") I get Alias not found even though I can see it in the database

Edward,
Yes Access wouldn't understand the ttod() function as many backends wouldn't. But you don't need it. In access your tablename is 'Agent_Details_001' and fieldName is 'Datetime', right ?
Then it's simply this view :
dStartDate = {^2003/01/01} && Any date would do for initial creation
CREATE SQL VIEW Temp_Agent_details CONNECTION arcview AS ;
	SELECT * ;
 	FROM Agent_Details_001  ;
    	WHERE Agent_Details_001.datetime = ?dStartDate
I read your reply to Pamela about 'this'. But Pamela was right as I told you too before. If you do that within a class :
-That object must exist
-Probably would cause recreation of the view over and over - bloating the DBC quickly.

Instead just create the view once as above. When you want to use the table or requery just supply the new date value. ie:
* Open view retrieving with dStartDate initial value
dStartDate = {^2002/12/25}
use myDBC!Temp_Agent_details alias myAgent

* Change dStartDate value - You could use this one in class
dStartDate = this.dStartDate
requery('myAgent')
Or open the view with nodata and populate when you need (ie: In your class) :
oAccess = createobject('myArcView')
oAccess.dStartDate = {^2001/01/01}
oAccess.GetData
browse

define class myArcView as custom
 Alias = 'myAgent'
 dStartDate = {}
 Procedure Init
 use myDBC!Temp_Agent_details alias (this.Alias) NODATA
endproc
 Procedure GetData
 local dStartDate
 dStartDate = this.StartDate
 requery(this.Alias)
Endproc
enddefine
If you still want to do this from a class then consider SPT instead. It wouldn't create a view in DBC (utilize and throw w/o making new entries in DBC - and you don't need a DBC).

PS: Do you want a full sample ?
Another ESRI user:)
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform