
Problem with Dbase IV tables
I'm having a problem with accessing Dbase IV tables
in VB 4.0. I have to make my tables usable with R&R
Report Writer v.6.5 so changing table types is not an
option. :(
Anyway, what I'm trying to do is dynamically check to
see if any records exist matching a certain criterion.
If they do then I want to disable a couple of button
controls. The criterion is based on input entered into
a combo box, therefore, I am trying to do my checking in
the change event of the combo box. This is the code I'm
using:
Dim SomeData As Recordset, aDB As Database
Set aDB = Workspaces(0).OpenDatabase("EMP", False, True, _
"Dbase IV;DATABASE=" & App.Path)
'group_num is an integer
SQL$ = "Select * From EMP Where GROUP = " & Cstr(group_num)
Set SomeData = aDB.OpenRecordset(SQL$, dbOpenDynaset)
If SomeData.EOF Then
Command1.Enabled = False
Else
Command1.Enabled = True
I also tryed using a data control but it kept telling me my SQL
query was wrong. This code gives me an error saying I have
a malformed where clause but The EXACT same query works fine
in a different portion of code where I'm changing the recordsource
property of a data control.
Can anyone please help me with this?
Thanks alot,
Michael LeBlanc