Results 1 to 2 of 2

Thread: Crystal Report

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Location
    /root/usr/local/bin
    Posts
    476

    Crystal Report

    hello!

    before my access database has no password and it is working,
    and i set a password now my report asking for a password


    public static string conString = @"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source= " + Application.StartupPath + "/CQSTest.MDB" +";Persist Security Info=False;jet oledb:database password=1234567";

    it is working on login

    tnx

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Location
    /root/usr/local/bin
    Posts
    476

    Re: Crystal Report

    i use this code but in crystal report it shows the logon diaglog box

    public static string conString = @"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source= " + Application.StartupPath + "/CQSTest.MDB" +";Persist Security Info=False;jet oledb:database password=1234567";


    this.Cursor = Cursors.WaitCursor;
    OleDbConnection conn = new OleDbConnection(cVar.conString);
    conn.Open();
    OleDbCommand comm = conn.CreateCommand();

    comm.CommandText = "SELECT * FROM tblData WHERE COMPOUND_NO = '" + cboCompoundNo.Text + "' AND MIXING_DATE BETWEEN #" + dtpFrom.Text + "# AND #" + dtpTo.Text + "# ORDER BY MIXING_DATE DESC";
    cVar.dataReader = comm.ExecuteReader();
    try
    {
    if (cVar.dataReader.HasRows)
    {
    cVar.dataReader.Close();
    OleDbDataAdapter da = new OleDbDataAdapter(comm);
    DataTable dt = new DataTable();
    da.Fill(dt);

    //INSERT_DUMMY_DATE_COVERED();

    crData cData = new crData();//landscape
    cData.SetDataSource(dt);
    frmPrintPreview fData = new frmPrintPreview();
    fData.crystalReportViewer1.ReportSource = cData;
    fData.ShowDialog();
    }
    else
    {
    MessageBox.Show("Record not found, please try again.", "No record", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
    }
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
    cVar.dataReader.Close();
    conn.Close();
    this.Cursor = Cursors.Default;
    }

    need help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width