Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access front-end to Oracle & Y/N datatype

Status
Not open for further replies.

ayjaycee

Technical User
Mar 5, 2001
291
GB
In an Access database, you can define a column as Y/N (i.e. binary 0 or 1).

If you are using Access as a front-end to an Oracle database, what datatype would you use to get the same functionality?

Or is this not possible?

Thanks,
TandA

One by one, the penguins steal my sanity.
 
I believe you will find it to be 1 character of text since Oracle uses a char "Y" and "N" while Access uses a -1 and 0 numeric value for a boolean. I came across this doing my Oracle homework.

Steve King Growth follows a healthy professional curiosity
 
We had it defined as CHAR(1) & it didn't seem to work. I've redefined it as NUM(1) & will ask the developer to try it again tomorrow.

Ta TandA

One by one, the penguins steal my sanity.
 
Since Oracle doesn't have a boolean you will have to use the Char(1) to emulate an Access boolean.

You could do something like this or you could just check for the "Y" and "N".

Function ReadBool(strValue As String) As Boolean
Select Case strValue
Case "Y"
ReadBool = True
Case "N"
ReadBool = False
End Select
Exit Function

Steve King Growth follows a healthy professional curiosity
 
In all actuality, Oracle doesn't care what type it is. It is just storing a value. Since Access is your front end, you just have to match up to what ever you store. So, Steve's chunk of code could be modified to work with characters or numbers. I would just try to make it logical to who ever has to maintain it and DOCUMENT it! Terry M. Hoey
 
Update:

Tried NUM(1) - no good.

Tried CHAR(3) - worked!

Looked at the data - the field has a "0" in it, so I'm confused as to why the NUM(1) didn't work.

Oh well, as long as it's working ... TandA

One by one, the penguins steal my sanity.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top