Hi...
We have a VB 6.0 application which has 128 forms, 6 modules, and 54
class modules in it. We are currently looking at moving from Access DB
as our back-end to SQL. Converting a database from Access to SQL is not
a big deal for us but the challenge which we face right now is, in VB
application, all our sql statements have date delimiter as "#" while in
SQL the date delimiter should be "'" (single quote). With this huge
project, keeping this change in mind, changing each and every delimiter
is a painful task. we can't look at find "#" and replace it with "'"
(single quote) as we need this application to be compatible with Access
as well as SQL. I was just wondering if we have an automated way to
make this application compatible with SQL rather than changing the date
delimiters in each and every form. Help on this one will be greatly
appreciated. Thank you.
Hetal.
Douglas J. Steele - 24 Feb 2006 20:40 GMT
What I've done is use a function to format the date as is appropriate for
the specific case.
I show an example of this in my September, 2003 "Access Answers" column in
Pinnacle Publication's "Smart Access"
You can download the column (and sample database) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Hi...
>
[quoted text clipped - 13 lines]
>
> Hetal.
Hetal - 25 Feb 2006 00:17 GMT
Hi Douglas,
On few of our applications we did the same thing but in a different
way, we declared a variable which, based on database type, gets
populated as "#" or "'" (single quote) and we used to use that variable
as a delimiter in our sql statements.... but i like your way of doing
it... it looks much neater and is comparitively faster to update the
code.
Thanks a bunch....
Hetal.
boaz - 27 Feb 2006 23:21 GMT
I don't have a solution for you because I don't know how.
This is what I do though.
I need to deal with all kind of database systems. They all want different
things for a date. So, I stop using the Date data type all together. I am
using a Long Integer to store date.
e.g.
9/23/2005 -> I store it as 20050923
work pretty good.
> Hi...
>
[quoted text clipped - 13 lines]
>
> Hetal.