Access question - data type

Results 1 to 2 of 2

Thread: Access question - data type

  1. #1
    Join Date
    Dec 1969

    Default Access question - data type

    In Access 2000, it gives the option of a yes/no data type. I would like to use this, but cannot figure out how to refer to this in my program.<BR><BR>I&#039;ved tried:<BR>= vbchecked<BR>&#062; 0<BR>= true<BR><BR>and on. If necessary I will use a 0/1 boolean number field, but I was hoping that I wouldn&#039;t need to.<BR><BR>Any ideas?<BR><BR><BR>Mat

  2. #2 Guest

    Default RE: Access question - data type

    Hi Mat,<BR>Normally Yes/No fields when accessed in a VB Program return True/False values. Thus in the following example, it works fine when I check the &#039;oRS.Fields("IsValid").Value=false&#039; as given below:<BR><BR>Dim oCn As New ADODB.Connection<BR>Dim oRS As ADODB.Recordset<BR><BR>oCn.Provider = "Microsoft.Jet.OleDB.4.0"<BR>oCn.Open "C:db2.mdb"<BR>Set oRS = oCn.Execute("Select * from EmpDetails")<BR>Do While Not oRS.EOF<BR> Print oRS.Fields(1).Value & " : " & IIf(oRS.Fields("IsValid").Value = False, "Valid", "Invalid")<BR> oRS.MoveNext<BR>Loop<BR><BR>oRS.Close<BR>oCn.Close <BR><BR>Set oRS = Nothing<BR>Set oCn = Nothing<BR><BR>Thanks and regards,#<BR>Siva(<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts