Matching Data Types between RealBasic and the RealBasic Database 
Author Message
 Matching Data Types between RealBasic and the RealBasic Database

Hello,

I'm trying to create a generic function to write all kinds of data types to
a RealBasic Database table.

This is the code I use up to now, and ik works! Except for two datatypes:
boolean and time. Anyone an idea how to add these two?

        scurTbl=dbMS.SQLSelect(strSQL)
  scurFlds=dbMS.FieldSchema(txtTbl.Text)
  datObj=new date

  if scurTbl.EOF then
    msgBox "End of recordset reached"
  else
    scurTbl.edit
    for intCnt=1 to scurTbl.FieldCount
      select case scurFlds.IdxField(2).StringValue
      case "2"   'Small Integer
        scurTbl.idxField(intCnt).IntegerValue=val(fld(intCnt).Text)
      case "3"   'Integer
        scurTbl.idxField(intCnt).IntegerValue=val(fld(intCnt).Text)
      case "5"   'String
        scurTbl.idxField(intCnt).StringValue=fld(intCnt).Text
      case "6"   'Float
        scurTbl.idxField(intCnt).DoubleValue= CDbl(fld(intCnt).Text)
      case "7"   'Double
        scurTbl.idxField(intCnt).DoubleValue= CDbl(fld(intCnt).Text)
      case "8"   'Date
        if ParseDate(fld(intCnt).Text, datObj) then
          scurTbl.idxField(intCnt).DateValue=datObj
        end
      case "9"   'Time

      case "12" 'Boolean

      end select
      scurFlds.moveNext
    next
    scurTbl.update
  end



Tue, 24 Feb 2004 22:50:11 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Sound in RealBasic 4 Prof. (er, RealBasic)

2. realbasic to excel/realbasic vers excel

3. Looping over a directory and reading Jpegs into a database -- Realbasic 4.5

4. How do you use jpegs in a realbasic database on the PC

5. RealBasic Database and Export

6. RealBasic Database Date format

7. Foxpro Database - Access with REALBasic - Help

8. Altering a RealBasic Database

9. RealBasic database troubles

10. REALBasic 3.2 & Databases

11. Date SQL with REALbasic database

12. Database access in realbasic

 

 
Powered by phpBB® Forum Software