Field VolumeActivity:Int
Field FrequencyUpdateable:Int
Field SpecialAllowance:Int
These are all Booleans in the database.
The queryrecordset shows the correct values of 0 or 1 (1,0,0 respectively)
but once i put them in the Activity type they all show 1.
I scanned the dbodbc.bmx file and found the valid types of value (int, float, double, string etc).
There is nothing for Boolean but i think BMax doesn't have a boolean type either.
Any idea what is wrong with my code below?
Cheer
Glenn
Field FrequencyUpdateable:Int
Field SpecialAllowance:Int
These are all Booleans in the database.
The queryrecordset shows the correct values of 0 or 1 (1,0,0 respectively)
but once i put them in the Activity type they all show 1.
I scanned the dbodbc.bmx file and found the valid types of value (int, float, double, string etc).
There is nothing for Boolean but i think BMax doesn't have a boolean type either.
Any idea what is wrong with my code below?
Cheer
Glenn
SuperStrict Import BaH.DBODBC 'Include "DatabaseTypes.bmx" Type TActivity Field ActivityID:Int Field ActivityName:String Field ActivityDescription:String Field VolumeActivity:Int Field FrequencyUpdateable:Int Field SpecialAllowance:Int Field ActivityNumberForSorting:Int End Type ' You need to load a FILE DSN. Local db:TDBConnection = LoadDatabase("ODBC", "C2D-Productivity", Null, Null, Null, Null, "C2D-Productivity.dsn") ' Check that the DB connection has been made If Not db Then DebugLog("Didn't work...") DebugLog("Unable to Open the Database C2D-Productivity.mdb from the FILE DSN C2D-Productivity.dsn") Notify("Unable to Open the Database C2D-Productivity.mdb from the FILE DSN C2D-Productivity.dsn") End Else DebugLog("Connected to the Database C2D-Productivity.mdb from the FILE DSN C2D-Productivity.dsn") End If ' Check if the database has an error on opening If db.hasError() Then errorAndClose(db) End If DebugLog( "Database Loaded") If db.isOpen() Then DebugLog ("open the tblActivity table") Local query:TDatabaseQuery = db.executeQuery("SELECT * from tblActivity") If db.hasError() Then errorAndClose(db) End If ' create a list to hold the activities Local ActivityList:TList=CreateList() DebugLog("create a list to hold the activities") While query.nextrow() Local record:TQueryRecord = query.rowRecord() DebugStop Local Activity:TActivity = New TActivity Activity.ActivityID = TDBInt(record.value(6)).value DebugLog(Activity.ActivityID) Activity.ActivityName = TDBString(record.value(1)).value DebugLog(Activity.ActivityName) Activity.ActivityDescription = TDBString(record.value(2)).value DebugLog(Activity.ActivityDescription) Activity.VolumeActivity = TDBInt(record.value(6)).value DebugLog(Activity.VolumeActivity) Activity.FrequencyUpdateable = TDBInt(record.value(6)).value DebugLog(Activity.FrequencyUpdateable) Activity.SpecialAllowance = TDBInt(record.value(6)).value DebugLog(Activity.SpecialAllowance) Activity.ActivityNumberForSorting = TDBInt(record.value(6)).value DebugLog(Activity.ActivityNumberForSorting) ListAddLast(ActivityList,Activity) Wend End If db.close() Function errorAndClose(db:TDBConnection) DebugLog(db.error().toString()) db.close() Notify("Read the DebugLog to see what the error was") End End Function