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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set null value to a text area?

Status
Not open for further replies.

debrac

IS-IT--Management
Jan 9, 2001
48
0
0
AU
how can i set a null value or empty string to a memo field (text area)in a recordset, using vb?

this does not work:
fld.value= Null

thanks
 
No, try using empty string value
fld.value=""
________
George, M
 
that does not work. any other ideas?
 
This should work if the memo field accepts null value...
Please post your part of code witch updates the database... ________
George, M
 
This issue here is how to get a null value into a database field using the textarea's representation of no data.

In HTML, form fields do not support null values, only empty strings to represent no data. This means that in your 'Input Into' Or .AddNew commands you will have to handle for the difference between datatypes if you wish to place a null into a table's field.

Assuming you post the data to some script:
<%
'SomeScript.asp
Dim f1 : f1 = Request(&quot;taF1&quot;) 'taF1 is Text Area 1
Dim f2 : f2 = Request(&quot;taF2&quot;) 'taF2 is Text Area 2
Dim oCon

Function getDBSV(ByVal sData)
'Get DataBase String Value (getDBV)
If sData = &quot;&quot; Then
getDBSV = &quot;Null&quot;
Else
getDBSV = &quot;'&quot; & sData & &quot;'&quot;
End If
End Function

'Create Connection Object
'bla bla
oCon.Execute = &quot;Insert Into tblX (fld1, fld2) Values (&quot; & getDBSV(f1) & &quot;,&quot; & getDBSV(f2) & &quot;)&quot;

%>
 
Pardon the silly &quot;Input Into&quot; Statement. Stupid Stupid Stupid :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top