🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
1 messages
1 total messages Started by JAMES JAVA Wed, 28 Mar 2001 12:08
Cannot access database!
#5655
Author: JAMES JAVA
Date: Wed, 28 Mar 2001 12:08
48 lines
2050 bytes
The program is login screen and then press the login value to
database->params but cannot access. First, database->LoginPrompt = false
The program are following , pls help me!

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include "Unit2.h"

//--------------------------------------------------------------------------
-
#pragma package(smart_init)
#pragma resource "*.dfm"
TfrmLogin *frmLogin;
int passcount = 0;

//--------------------------------------------------------------------------
-
__fastcall TfrmLogin::TfrmLogin(TComponent* Owner)
        : TForm(Owner)
{

}
//--------------------------------------------------------------------------
-
void __fastcall TfrmLogin::OKClick(TObject *Sender)
{

    if(++passcount==3) {
    MessageBox(NULL, "Incorrect Login", "Warning", MB_OK);
    Close();
  }

  try {

    frmMain->Database1->Params->Values["User Name"]=Edit1->Text;
    frmMain->Database1->Params->Values["Password"]=Edit2->Text;
    frmMain->Database1->Connected = true;
    frmLogin->Hide();
    frmMain->ShowModal();
    Application->Terminate();
  } catch(...) {
    MessageBeep(MB_ICONHAND);
    ShowMessage("Input error, try again");
    Edit1->SetFocus();
    }
}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads