Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1

    consenti lunghezza zero

    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.

  2. #2
    Utente di HTML.it L'avatar di sebamix
    Registrato dal
    Aug 2000
    Messaggi
    1,028
    Il DB è Access, SQL Server, ORACLE, MySQL?


  3. #3
    Avevo lo stesso problema tuo utilizzando una tabella di Access come database e ho risolto settando direttamente il campo sulla struttura di Access.

    Ciao

  4. #4

  5. #5
    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
    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...

  6. #6
    Utente di HTML.it L'avatar di sebamix
    Registrato dal
    Aug 2000
    Messaggi
    1,028
    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...
    Se vuoi una buona notizia meglio che sto zitto.
    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ù.


  7. #7

  8. #8
    Scusate ma con dao so che c'è la possibilità di settare la proprietà allowzerolenght...

    O no?

  9. #9
    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?

  10. #10
    A me da un errore...
    Che riferimento devo inserire?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.