Perche non riesco a settare al campo 'prova' aggiunto la proprietà 'consenti lunghezza zero' con questa query?
ALTER TABLE `agenti` ADD `prova2` char allowzerolength
Ciao.
Perche non riesco a settare al campo 'prova' aggiunto la proprietà 'consenti lunghezza zero' con questa query?
ALTER TABLE `agenti` ADD `prova2` char allowzerolength
Ciao.
Il DB è Access, SQL Server, ORACLE, MySQL?
![]()
Avevo lo stesso problema tuo utilizzando una tabella di Access come database e ho risolto settando direttamente il campo sulla struttura di Access.
Ciao
Il database è access.
Scusa ma come faccio per i miei clienti?Originariamente inviato da anatroccolo
Avevo lo stesso problema tuo utilizzando una tabella di Access come database e ho risolto settando direttamente il campo sulla struttura di Access.
Ciao
Devo andare da tutti e cambiare la struttura a mano????
Sono sicuro che si possa fare qualcosa...
Se vuoi una buona notizia meglio che sto zitto.Originariamente inviato da magnus
Scusa ma come faccio per i miei clienti?
Devo andare da tutti e cambiare la struttura a mano????
Sono sicuro che si possa fare qualcosa...![]()
Allora: qui in ditta per aggiornare i database prima utilizzavamo alter table, create table,... ma abbiamo abbandonato questo metodo perchè troppo limitato (tra le altre cose era impossibile far accettare a un campo testo valori null). Siamo quindi passati ad ADOX ma lo stiamo abbandonando sempre per lo stesso motivo (anche con adox no campi testo che accettano valori null).
Ci stiamo studianod DDL (Data Definition Language) ma non ti so dire di più.
![]()
![]()
![]()
Grazie comunque...
Scusate ma con dao so che c'è la possibilità di settare la proprietà allowzerolenght...
O no?
Inoltre in rete ho trovato questo:
'**************************************
' Name: AllowZeroLength
' Description:All fields in the selected
' table are processed and the AllowZeroLen
' gth property of the fields are set to ei
' ther True or False, depending on the Sta
' tus given as the finaal parameter The fu
' nction returns a boolean value that can
' be used by the user to determin other op
' erations.
' By: Killcrazy
'
' Inputs:strDatabase = Full database pat
' h
strTableName = Name of table To be processed
Status : True / False
'
' Returns:True/False
'
'This code is copyrighted and has' limited warranties.Please see http://w
' ww.Planet-Source-Code.com/xq/ASP/txtCode
' Id.2279/lngWId.1/qx/vb/scripts/ShowCode.
' htm'for details.'**************************************
Function AllowZeroLength(strDatabase As String, strtablename As String, status As Boolean) As Boolean
Dim db As Database
Dim td As TableDef
Dim fd As Field
On Error Goto Error_Handler
Set db = OpenDatabase(strDatabase)
Set td = db.TableDefs(strtablename)
'loop through the fields in the selected
' recordset
For Each fd In td.Fields
'Check the field type, and only change t
' he value of text and memo fields
If fd.Type = dbText Or dbMemo Then
If status = True Then
fd.AllowZeroLength = True
Else
fd.AllowZeroLength = False
End If
End If
Next fd
AllowZeroLength = True
' Exit Early to avoid error handler.
Exit Function
Error_Handler:
' Raise an error.
Err.Raise Err.Number, "AllowZeroLength", "Could Not process fields.", Err.Description
AllowZeroLength = False
' Reset normal error checking.
Resume Next
End Function
Ci può servire?![]()
A me da un errore...
Che riferimento devo inserire?