Article View: borland.public.vdbase.data.sql
Article #1231Translation of Dbase Boolean to SQL Server 6.5
From: Jorge Matos
Date: Wed, 11 Mar 1998 00:00
Date: Wed, 11 Mar 1998 00:00
41 lines
2029 bytes
2029 bytes
Hello,
I exported a dbf table that has a boolean field to SQL Server 6.5 and I
noticed that it converted the DBASE Logical type to a SQL Server Bit field
type. The problem I have is that I have a query object in VDB 7 that looks
like this "select * from table where mylogicalfield = true" this works if
the table is a DBASE table but when I try it against the SQL Server version
of the table, I get a BDE error message "Database Engine Error: Could not
find object". If I change my query to be "select * from table where
mylogicalfield = 1" then it works.
I could write code that checked the "driverName" property of my database
object and then I could chose the appropriate query sql string , for example
d = new database()
d.databaseName = "BDE ALIAS FOR DBASE TABLE"
d.active = true
q = new query()
q.database = d
if d.driverName = "DBASE"
q.sql = "select * from table where field = true"
else
q.sql = "select * from table where field = 1"
endif
q.active = true
The above code would still work when I change the databaseName property to a
BDE alias for SQL Server, but I think this is a kludge and I wonder if
theres a better solution to this problem. I also can't believe I would be
the only one to encounter this problem and I hope someone else has a better
solution to this. I'm hoping there is a better way to phrase my sql
statement so that it would work regardless of which BDE alias my database
object is using.
Thanks in Advance
Jorge Matos
Technical Details
Message-ID:
<6e6j9o$ah414@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,cfa2dced4e9ffd54,start X-Google-Attributes: gidff5a1,public From: "Jorge Matos" <matosj@dmac.com> Subject: Translation of Dbase Boolean to SQL Server 6.5 Date: 1998/03/11 Message-ID: <6e6j9o$ah414@forums.borland.com> X-Deja-AN: 333046259 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.vdbase.data.sql