G
Günter Brandstätter
Hi all,
I have a tricky problem with an SQL-string in a form. I need to make a query
on a boolean field in a table. What I do is to open a DAO recordset with a
predefined SQL-string.
The String looks like this:
"SELECT blabla FROM table WHERE myBoolean=" & bMyBoolean
set rst = CodeDb.OpenRecordset(strSQL)
should work but it does not, because I work with a german version of
MS-Access the interpreter interprets the variable bMyBoolean as the german
word "Wahr" instead of "True".
I tried the following:
If bMyBoolean = True then
bMyBoolean = "True"
Else
bMyBoolean = "False"
End If
and used the same SQL-String to create a QueryDef and executed this query.
It works when I open the created query by hand. When I try to open a
recordset using this query in code, it does not work
My question: How should I treat my Boolean-variable to make it say "True"
and "False" even in german environment??
Any answer appreciated
Günter
I have a tricky problem with an SQL-string in a form. I need to make a query
on a boolean field in a table. What I do is to open a DAO recordset with a
predefined SQL-string.
The String looks like this:
"SELECT blabla FROM table WHERE myBoolean=" & bMyBoolean
set rst = CodeDb.OpenRecordset(strSQL)
should work but it does not, because I work with a german version of
MS-Access the interpreter interprets the variable bMyBoolean as the german
word "Wahr" instead of "True".
I tried the following:
If bMyBoolean = True then
bMyBoolean = "True"
Else
bMyBoolean = "False"
End If
and used the same SQL-String to create a QueryDef and executed this query.
It works when I open the created query by hand. When I try to open a
recordset using this query in code, it does not work
My question: How should I treat my Boolean-variable to make it say "True"
and "False" even in german environment??
Any answer appreciated
Günter