Hello,
My appliaction needs to create some new text fields in an Access database table during a version upgrade.
I am using dbExpressADO.
The ALTER TABLE command works fine and adds the fields I need to the table.
The problem is that the AllowZeroLength property of each new field is set to NO, this needs to be YES.
Does anyone know how I can create a new text field with an SQL statement, and set AllowZeroLength=YES?
Another question ...
I have looked over the web for this and come up with an Access Module that will fix the problem. When run, it goes over the whole database and sets all text fields AllowZeroLength=YES.
Using this module would solve my problem mentioned above.
But I can't call it using an SQL Statement.
Does anyone know how I can call this M$Access Function via my ADO connection?
Thankyou for considering my questions.
Tim
My appliaction needs to create some new text fields in an Access database table during a version upgrade.
I am using dbExpressADO.
The ALTER TABLE command works fine and adds the fields I need to the table.
The problem is that the AllowZeroLength property of each new field is set to NO, this needs to be YES.
Does anyone know how I can create a new text field with an SQL statement, and set AllowZeroLength=YES?
Another question ...
I have looked over the web for this and come up with an Access Module that will fix the problem. When run, it goes over the whole database and sets all text fields AllowZeroLength=YES.
Code:
Public Function SNL_AllowZeroLength() As Integer
Dim db As Database, tdf As TableDef, fld As Field
Set db = CurrentDb
For Each tdf In db.TableDefs
If tdf.Attributes = 0 Then
For Each fld In tdf.Fields
If fld.Type = dbText Or fld.Type = dbMemo Then
If fld.AllowZeroLength <> True Then fld.AllowZeroLength = True
End If
Next fld
End If
Next tdf
SNL_AllowZeroLength = 1
End Function
Using this module would solve my problem mentioned above.
But I can't call it using an SQL Statement.
Does anyone know how I can call this M$Access Function via my ADO connection?
Thankyou for considering my questions.
Tim