Subject Re: How to use a Dbase app on two geographically diverse locations
From Mervyn Bick <invalid@invalid.invalid>
Date Thu, 18 Jan 2018 10:49:09 +0200
Newsgroups dbase.getting-started

On 2018-01-18 9:19 AM, Akshat Kapoor wrote:

>
> Thank You Ronnie, Ken , Mervyn
>
> I was successful in converting one of my forms to use MariaDB of Xampp.
>
> Leaving the issue of date it is working fine on local and client computers.
>
> For date the sql server accepts yyyy-mm-dd format and I have been using
> dd-mm-yyyy.
> Using set date to ansi alters the date of form.header.mdate.value from
> 18.01.2018 to 11.07.2023
> will have to use something on the pattern of
> str(year(mdate),4,0)+"-"+str(month(mdate),2,0,0).....
>
> Will do it tonight.
>
MariaDB uses 'yyyy-mm-dd' as its basic date format.  It will, however,
apparently also accept other formats including an undelimited yyyymmdd
value.  This is the format that the dBASE function dtos() produces
irrespective of what the computer's date format is set to.  So, perhaps
something like

cFld1 = 'test'
dDate = date()

cmd = "insert into tablename (fld1,datefld)
values('"+cFld1+"',"+dtos(dDate)+")"
oDatabase.executeSQL(cmd)

CYA statement.  I don't have access to MariaDB so this is untested and
may need some work. :-)

When records are retrieved dBASE will display the dates in the format
set for the computer.

Remember that all SQL tables must have a primary key otherwise you can't
reliably update or delete a specific record.   MariaDB has an
auto_increment field type so that is easily taken care of.

SQL, in general, requires single quotes to delimit text literals and
MariaDB is probably no different.

If you are going to use SQL consider using ADO rather than the BDE.
Either way, using a SQL server requires a different approach to
programming compared to using .dbf files.  Fortunately you have been
using INSERT and UPDATE commands to write to your tables so the changes
required should be minimal.  (If not minimal then at least easily
managed.  :-) )

This thread has gone way off-topic.  Perhaps a new thread in the
sql-server newsgroup?

Mervyn.