一但使用this.printDocument1.Print();就会出现"Microsoft Jet 数据库引擎找不到输入表或查询...."错误!!printDocument1_PrintPage()方法内没有任何代码都出现这个错误!!但是注释掉this.printDocument1.Print();错误就不回出现!!请高手指点这是什么原因???

解决方案 »

  1.   

    最核心的代码,不需要初始化窗体的代码。
    另外不要说得那么惊心动魄,什么bug之类的。我们用得挺好的。
      

  2.   

    private void button3_Click(object sender, EventArgs e)
            {
                Form2 frmprogressBar = new Form2();  //自动加载图像页面 
                if (bInert)
                {
                    if (DialogResult.Yes == (MessageBox.Show("是否打印数据资料", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)))
                    {                    
                        frmprogressBar.Show();
                        i++;
                        string[] row0 ={ i.ToString(), tLable.intoLable01, tLable.intoLable03, tLable.intoLable05, tLable.intoLable06 + "-" + tLable.intoLable07, tLable.intoLable08, tLable.intoLable09, tLable.intoLable10, tLable.intoLable11 };
                        DataGridViewRowCollection drow = this.dataGridView1.Rows;
                        drow.Insert(0, row0);
                        this.dataGridView1.Rows[0].Selected = true;                                     this.prjuser.ProjectName = tLable.intoLable03;
                        this.prjuser.CarNum = tLable.intoLable01;
                        this.prjuser.StartSite = tLable.intoLable06;
                        this.prjuser.EndSite = tLable.intoLable07;
                        this.prjuser.MileagePlyes = int.Parse(tLable.intoLable08.ToString());
                        this.prjuser.OverRunClass = tLable.intoLable04;
                        this.prjuser.OverRunNum = float.Parse(tLable.intoLable05.ToString());
                        this.prjuser.Unit = "吨/公里";
                        this.prjuser.UnitPrice = float.Parse(dBZ.ToString());
                        this.prjuser.PrjMoney = float.Parse(this.tLable.intoLable05) * float.Parse(this.tLable.intoLable08) * dBZ;
                        this.prjuser.Decs = tLable.intoLable11;
                        this.prjuser.GreatTime = DateTime.Now;
                        this.prjuser.userName = sAcc;
                        dbconn.saveUser(this.prjuser);                    this.printDocument1.Print();      //出错,注释掉后,无错误!print内没有任何代码!                    this.txtCheHAo1.Text = "";
                        this.txtPay1.Text = "";
                        this.txtCheWeight1.Text = "";
                        this.txtTonnage1.Text = "";
                        this.cmbAdrr1.SelectedIndex = 0;
                        this.cmbAdrr2.SelectedIndex = 0;
                        for (int n = 0; n < this.checkedListBox1.Items.Count; n++)
                        {
                            this.checkedListBox1.SetItemCheckState(n, CheckState.Unchecked);
                        }
                        this.checkedListBox1.ClearSelected();  
                        bInert = false;
                    }
                }
                else
                {
                    MessageBox.Show("只有添加数据资料后才能打印数据资料", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                frmprogressBar.Close();
            }
      

  3.   

    还是那个这个问题的帖子!!!不过沉地了!!
    http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079
      

  4.   

    还是那个这个问题的帖子!!!不过沉地了!!
    http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079
      

  5.   

    你说的Bug是没有,你使用的有问题倒是有的。
    问题描述的不清楚。先照着书谢谢例程,再说。
      

  6.   

    关键是this.printDocument1打印也正常,就是使用了this.printDocument1后出现数据库Microsoft Jet 数据库引擎找不到输入表或查询....这个错误!!去掉this.printDocument1后就不会出现这个问题!!而且为了调试我this.printDocument1内没有任何代码也出错!郁闷!!
      

  7.   

    顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079
      

  8.   

    顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079
      

  9.   

    顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!
    http://community.csdn.net/Expert/topic/5188/5188998.xml?temp=.2444727
      

  10.   

    顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!
    http://community.csdn.net/Expert/topic/5188/5188998.xml?temp=.2444727
      

  11.   

    顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!
    http://community.csdn.net/Expert/topic/5188/5188998.xml?temp=.2444727