By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 3,068 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Programatically checking Allows Null property of a column

P: 1
SQL such as the following returns the Allows Null property of a column in SQL Server:
Expand|Select|Wrap|Line Numbers
  1. select is_nullable from information_schema.columns where 
  2.   table_name = 'TheTableName' and 
  3.   column_name = 'TheColumnName'
  4.  
I need to do the same in MS Access and have tried the following:
Expand|Select|Wrap|Line Numbers
  1. select ColumnProperty( Object_ID('TheTableName'), 'TheColumnName',
  2. 'AllowsNull')
I get the error: 'Undefined function ColumnProperty in expression'.

I am programming in Delphi (using a TADOQuery) with an Access97 database.

Any clues would be much appreciated.
Oct 9 '07 #1
Share this Question
Share on Google+
3 Replies


RedSon
Expert 5K+
P: 5,000
Maybe the nice folks in mySQL can be of assistance. To the folks in mySQL, let me know if I should have moved it elsewhere ;-)
Oct 9 '07 #2

pbmods
Expert 5K+
P: 5,821
Heya, bmcallister. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=sql]
SQL code goes here.
[/CODE]

I'm going to go ahead and move this thread to the Access forum, where our resident Experts will be better able to help you out.
Oct 10 '07 #3

FishVal
Expert 2.5K+
P: 2,653
Hi, there.

I'm not sure JetSQL supports something like you are expecting.
Here is example of how it may be done in VBA via Access object model.
Expand|Select|Wrap|Line Numbers
  1. Public Function GetFieldRequiredProperty(txtTable As String, _
  2.                                          txtField As String) As Boolean
  3.  
  4.     GetFieldRequiredProperty = _
  5.         CurrentDb.TableDefs(txtTable).Fields(txtField).Required
  6.  
  7. End Function
  8.  
Oct 10 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.