Masked Edit Control and Remote data control problem

Masked Edit Control and Remote data control problem

Post by Amrish K. La » Thu, 17 Jul 1997 04:00:00



I have a form with two controls: A Masked Edit control and a Remote data
control. There is also an
"OK" button on the form

I type in data into the Masked Edit control and then click OK (the
program goes to CBlueWhiteFormView::OnSlipOk() function). The data that
I had typed into the masked edit control is fed into the database. But
then I get a dialog box with the message:"No open cursor or cursor
closed". Why do I get this error message? How do I get rid of this error
message?. I am using an ODBC connection to the database.

void CBlueWhiteFormView::OnSlipsOk()
{
 CMSMask* StudentIDBox = (CMSMask*) GetDlgItem(IDC_STUDENT_ID_BOX);
 CRdc* SlipRDC = (CRdc*) GetDlgItem(IDC_SLIP_RDC);
 ASSERT(StudentIDBox != NULL && SlipRDC != NULL);
 if (StudentIDBox != NULL && SlipRDC != NULL)
 {
  SlipRDC->SetDataSourceName(_T("security"));
  SlipRDC->SetCursorDriver(2);

StudentIDBox->BindDefaultProperty(0x16,VT_BSTR,_T("STUDENT_ID"),SlipRDC);

  strStudentID = StudentIDBox->GetText();
  strStudentID = _T("INSERT INTO SLIPTABLE (STUDENT_ID) VALUES ('") +
                 strStudentID + _T("')");

  SlipRDC->SetSql(strStudentID);
  SlipRDC->Refresh();
  //StudentIDBox->Refresh();
 }

Quote:}

 
 
 

1. problems with Mask edit controls bound to data controls

To control user's input, I would like use Mask edit.
On my form I have a button, to add a new record, but when VB execute
        Data.recordset.addnew
I have a validation error and after a run-time error, with the empty
field (His mask is ?######), and I can't resume this error.

Somebody has an idea where i'm mistaking (i think it's possible to
add a new records with this control.

        Thank Your for your help

        Arnaud - France - Paris

2. Shrink Db / Reindex issue

3. Masked Edit Control do not update entered data ...

4. OpenQueryDef ???

5. Masked Edit Control Problem

6. Network setup rescue

7. Masked Edit Control /AddNew Problem

8. OpenQuery AND Where Question

9. Problems with the Masked Edit control in VB4.0

10. Problem with bound DataCombo and Masked Edit controls when changing their contents

11. Masked Edit Control date type problem

12. Problem with Masked Edit control...

13. Problem with Masked Edit Control 6.0