Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    [VB6] Aggiunta record al Database

    Ragazzi con questo codice non riesco ad aggiornare il mio DATABASE.Aiutatemi Sto IMPAZZ.......
    Private Sub Command1_Click()

    If txtLast.Text = "" Then
    MsgBox "il campo " & txtLast.Name & " è vuoto"
    Exit Sub



    End If
    If txtTitle.Text = "" Then
    MsgBox "il campo " & txtTitle.Name & " è vuoto"
    Exit Sub


    End If
    If txtDisp.Text = "" Then
    MsgBox "il campo " & txtDisp.Name & " è vuoto"
    Exit Sub
    End If
    If txtNick.Text = "" Then
    MsgBox "il campo " & txtNick.Name & " è vuoto"
    Exit Sub
    End If
    Exit Sub

    If txtEmail.Text = "" Then
    MsgBox "il campo " & txtEmail.Name & " è vuoto"
    Exit Sub
    End If
    Exit Sub

    strO_F = txtLast.Text
    strPiano = txtTitle
    strCall_Center = txtDisp.Text
    strOperatore_SIT = txtEmail.Text
    strDataApertura = txtNick.Text

    With Data1.Recordset

    .AddNew
    !O_F = strO_F
    !Piano = strPiano
    !Call_Center = strCall_Center
    !Operatore_SIT = strOperatore_SIT
    !DataApertura = strDataApertura
    .Update

    End With
    Unload Me

    End Sub
    Non riesco ad associare i dati ai campi.Premetto che il form dove ci sono i textbox all'avvio risulta pulito da ogni dato e quello che vorrei fare e di aggiornare il mio DB solo Alla pressione del tasto command1 con la chiusura del Form stesso.Grazie Anticipatamente
    codice:
    VB6

  2. #2
    Non è che forse sbagli qui?!:
    strO_F = txtLast.Text
    strPiano = txtTitle
    strCall_Center = txtDisp.Text
    strOperatore_SIT = txtEmail.Text
    strDataApertura = txtNick.Text
    Prova ad invertire, anche perchè qui non stai riempendo i textbox con i dati, ma stai facendo il contrario..

    ciao

  3. #3
    lo apri il database?
    cosa fa? ti da errore?

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 © 2024 vBulletin Solutions, Inc. All rights reserved.