Board index » delphi » Paradox to Access - Query Problem

Paradox to Access - Query Problem

I have a Paradox database I must convert to Access 97. I am slowly changing
the table access coding to use queries. I have run into a problem where a
date is param in an SQL statement. Simple queries with an integer param are
fine. Can't get the one that has a date param to work.

If anyone has some light to shed on this I would be grateful.

 

Re:Paradox to Access - Query Problem


Did you put the param in the following format:

Q1.params[0].asdate := StrToDate('10/06/1998');

It's been awhile but I think that's how I did it.

Bill

Quote
Ross Garbig wrote in message <01bdf181$67c6d100$7f81b7d1@rgarbig>...
>I have a Paradox database I must convert to Access 97. I am slowly changing
>the table access coding to use queries. I have run into a problem where a
>date is param in an SQL statement. Simple queries with an integer param are
>fine. Can't get the one that has a date param to work.

>If anyone has some light to shed on this I would be grateful.

Re:Paradox to Access - Query Problem


Quote
>I have a Paradox database I must convert to Access 97. I am slowly changing
>the table access coding to use queries. I have run into a problem where a
>date is param in an SQL statement. Simple queries with an integer param are
>fine. Can't get the one that has a date param to work.

>If anyone has some light to shed on this I would be grateful.

Access doesn't have a Date type field but it does have a DateTime type field
I susspect you need to make the paramater a DateTime type

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Paradox to Access - Query Problem


Quote
>Q1.params[0].asdate := StrToDate('10/06/1998');

Why not use
  Q1.params[0].AsDate := EncodeDate(1998, 06, 10);

This will work with any date format

Craig.

Re:Paradox to Access - Query Problem


Quote
Brian Bushay TeamB wrote in message <3623def1.33336680@floyd>...
>>I have a Paradox database I must convert to Access 97. I am slowly
changing
>>the table access coding to use queries. I have run into a problem where a
>>date is param in an SQL statement. Simple queries with an integer param
are
>>fine. Can't get the one that has a date param to work.

>>If anyone has some light to shed on this I would be grateful.

>Access doesn't have a Date type field but it does have a DateTime type
field
>I susspect you need to make the paramater a DateTime type

I'm not too sure if this is relevant, but I remember from my VB/Access days
that using dates in WHERE clauses required something like..

SELECT Field1, Field2 FROM Table1 WHERE DateField1 = #MM/DD/YYYY#

i.e note the # delimiters and the American date format...

Hope this helps (not too sure if it does though)

Gary Wilmot
Senior Developer
Visual Business Tools

Re:Paradox to Access - Query Problem


Why are you changing from TTables to TQueries? TTables are very fast agains
Access databases using the native BDE driver and are the recommended access
method.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Re:Paradox to Access - Query Problem


As a matter of fact, I did just that when I converted. I got rid of
some my queries in favor of tables. However, the one limitation I had
to code around was that Access TTables cannot use more than one field
for master-child relationships. If this is incorrect, then I must have
done something wrong. The tables I had built in Paradox that had
primary keys with multiple fields wouldn't do the relationship thing.
I had to create another field combining them into one.
Bill, if you could enlighten me, I'd appreciate it.

Woody

Quote
Bill Todd (TeamB) wrote in message

<6vh5fs$on...@forums.borland.com>...
Quote
>Why are you changing from TTables to TQueries? TTables are very fast
agains
>Access databases using the native BDE driver and are the recommended
access
>method.

>--
>Bill Todd
>(Sorry but TeamB cannot answer questions received via email)
>(Remove nospam from my email address to contact me for any other
reason)

Re:Paradox to Access - Query Problem


Quote
>'m not too sure if this is relevant, but I remember from my VB/Access days
>that using dates in WHERE clauses required something like..

In this case it is not relevent since the question involves using a paramater

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Paradox to Access - Query Problem


Interesting.  This is the first I have heard of the limitation on composite
keys. I'll have to look into that.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Re:Paradox to Access - Query Problem


Since when are TTables the "recommended access method" for Access? Is
it merely because the native Access driver has problems with TQuery?

Matt Jacobs

--

My reply-to address is purposely mangled to thwart auto-reply bots.
Please remove the two leading underscores if you wish to reply via
e-mail.

Re:Paradox to Access - Query Problem


Let me amplify that statement. I was told by someone within Inprise that
TTables provide very good performance with Access 97 tables and the native
driver. This person recommended them for creating Access apps. There are no
problems with queries that I am aware of in BDE 5.0, however, there were in
earlier versions of the BDE native Access driver.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Other Threads