Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 01-14-2018, 04:56 AM
FreakaZoid2 FreakaZoid2 is online now
Senior Member
 
Join Date: Jul 2009
Posts: 318
Default access database, firedac query, clientdataset

I have an Access Database with a Date/Time column. I have a fdquery that retrieves the table with the column in it. I can print it on fastreports and it works just fine. I have a maintenance program for it and it shows up in a datetimepicker just fine. last phase of my project requires that I use a clientdataset to access a specific feature. I actually got it all in place tdatasetprovider points to the dataset of the firedac query and the clientdataset points to the datasetprovider. When I try to use the component that requires a clientdataset, my date column is ignored and won't populate. we have figured out why is because the clientdataset thinks my date/time column is ftTimeStamp and not ftDateTime.
is there a way in the firedac query to force my date column to be ftDateTime?
  #2  
Old 01-15-2018, 11:16 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,270
Default

You could try this:
https://forums.embarcadero.com/messa...ssageID=680492

And then the part on the Connection.FormatOptions:
Code:
FConnection.FormatOptions.OwnMapRules := True;
with FConnection.FormatOptions.MapRules.Add
do begin
  SourceDataType := dtDateTimeStamp;
  TargetDataType := dtDateTime;
end;

with FConnection.FormatOptions.MapRules.Add
do begin
  SourceDataType := dtTime;
  TargetDataType := dtDateTime;
end;
  #3  
Old 01-15-2018, 05:35 PM
FreakaZoid2 FreakaZoid2 is online now
Senior Member
 
Join Date: Jul 2009
Posts: 318
Default i have added the maprules and still having issue

In my firedac query the field type is always ftTimeStamp.
when i used the Format(mydate, 'mm/dd/yyyy') as mydate_txt in my query and created a new field mydate_txt, it will actually work on my mailmerge but as text only and i lose all of the formatting options available to the mailmerge process related to date fields.
i am not sure if the maprules is not find dtDateTimeStamp as equal to the ftTimeStamp or if it is the MS Access side to always treat datetime fields as timestamp.
  #4  
Old 01-16-2018, 09:37 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,270
Default

I would say it's the maprules, but that should be an easy test on your side.
I'm not a firedac user, so cannot verify anything on this part. But users with similar problems all pointed to this maprules, so give it a try
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 05:24 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.