Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Cannot Get Field Nullable Property

Reply
Thread Tools

Cannot Get Field Nullable Property

 
 
Paul Eaton
Guest
Posts: n/a
 
      07-14-2003
Hi

I am using asp/vbscript/ado/mssql.

I am able to get the nullable property OK when generating a recordset
with a simple SQL statement such as "select Fld1,Fld2 from Table1" and
then looping thro' the fields and :-

Response.Write(rs.fields(x).attributes and adFldIsNullable)

When I use the following statement all fields are erroneously reported
as nullable:-

"Select B.Fld2, B.Fld3 From Table1 A Left Join Table2 B On
A.Fld1=B.Fld1"

Is this normal?
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      07-14-2003
This recordset may not even be updatable, and you're worried about whether
or not the fields are nullable?

If you set the Unique Table dynamic property, you may get the true results
for the fields. You can only set this property if you use a client-side
cursor (adUseClient). I have no idea if this will work. I've never tried to
update a recordset whose source was a multi-table select statement.

Bob Barrows

Paul Eaton wrote:
> Hi
>
> I am using asp/vbscript/ado/mssql.
>
> I am able to get the nullable property OK when generating a recordset
> with a simple SQL statement such as "select Fld1,Fld2 from Table1" and
> then looping thro' the fields and :-
>
> Response.Write(rs.fields(x).attributes and adFldIsNullable)
>
> When I use the following statement all fields are erroneously reported
> as nullable:-
>
> "Select B.Fld2, B.Fld3 From Table1 A Left Join Table2 B On
> A.Fld1=B.Fld1"
>
> Is this normal?



 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      07-14-2003
Do you need to get the *data* in order to get the metadata? How about
grabbing the column names and whether they are NULL or not from the I_S
view:

sql = "SELECT COLUMN_NAME, IS_NULLABLE " & _
" FROM INFORMATION_SCHEMA.COLUMNS " & _
" WHERE TABLE_NAME='Table1'"
set rs = conn.execute(sql)
do while not rs.eof
response.write rs(0) & " nullable? " & rs(1) & "<br>"
rs.movenext
loop





"Paul Eaton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi
>
> I am using asp/vbscript/ado/mssql.
>
> I am able to get the nullable property OK when generating a recordset
> with a simple SQL statement such as "select Fld1,Fld2 from Table1" and
> then looping thro' the fields and :-
>
> Response.Write(rs.fields(x).attributes and adFldIsNullable)
>
> When I use the following statement all fields are erroneously reported
> as nullable:-
>
> "Select B.Fld2, B.Fld3 From Table1 A Left Join Table2 B On
> A.Fld1=B.Fld1"
>
> Is this normal?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
Nullable property in property grid Rafał Zięba ASP .Net Building Controls 0 07-03-2008 11:32 AM
Error Rendering Control if nullable property is used Benton ASP .Net 2 04-17-2007 11:33 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
Property 'Keycode' is non-nullable Jacques Wentworth ASP .Net 0 03-11-2005 11:08 AM



Advertisments