date conversion fails

  • Thread starter Thread starter bobby
  • Start date Start date
B

bobby

I have distributed an application that works fine on most clients. But on
two clients I get an error in a specific function:

This is where things go wrong:
strSQL = "SELECT MyDate FROM tblHolidays WHERE MyDate BETWEEN '" &
Format(Me.txtDateFrom, "MM/DD/YYYY") & "' AND '" & Format(Me.txtDateTo,
"MM/DD/YYYY") & "'"
Set rst = CurrentProject.Connection.Execute(strSQL)

All clients should have same MDAC (2.8)

The txtDateFrom and txtDatoTo fields are both formattet as "short date" and
the client machines are set up with a dd-MM-yyyy short date format in
regional settings. The fields are locked.

Why does it only happen on 2 client machines and not all (or none)?
 
The format MM/DD/YYYY will be use by the SQL-Server is the client connect
with a login having English as its default language. You should check the
login property for these two clients and make sur that it is English and not
something else as French.

Also, it might be a good idea to display the string strSQL to make sure that
everything is OK.

S. L.
 
Back
Top