我的水晶报表不是vb自带的水晶报表。是我下载的水晶报表9做的
我在做水晶报表是步骤如下:
使用报表先导——标准---创建新连接---ole db(ado)---Microsoft OLE DB  provider for sql server.... 以这种方式连接的。
可在打包后装别的机子上,一直是提示。连接数据库失败
请问是怎么回事
这是我的代码
Private Sub Form_Load()
  Dim cry As CRAXDRT.Report
  Dim CRYAT As CRAXDRT.Application
  
  Dim rs As ADODB.Recordset
  Dim txtsql As String
  Dim msgtext As String
  Dim reportname As String
 
 txtsql = "insert into tt_try  select face_info.俱乐部名称,face_info.事件名称,face_info.事件级别,face_info.焦点时间,face_info.主队,face_info.客队 from face_info where 主队= '" & Trim(formMain.Option2.Caption) & " ' and 客队 = '" & Trim(formMain.Option1.Caption) & "' "
  Set rs = ExecuteSQL1(txtsql)
  Set rs = Nothing
   reportname = "\tt_try.rpt"
  Set CRYAT = New CRAXDRT.Application
  Set cry = CRYAT.OpenReport(App.Path & reportname)
  cry.ReportTitle = " " & Trim(formMain.Option2.Caption) & " vs " & Trim(formMain.Option1.Caption) & "  "  CR91.ReportSource = cry
  CR91.ViewReport

解决方案 »

  1.   

    你没有将水晶报表自带的dll打包
      mfc42.dll 
    msvcrt.dll 
    msvcp60.dll     
    comctl32.dll 
    comdlg32.dll 
    msvcirt.dll
    crviewer.dll
    craxdrt.dll
    craxddrt.dll
    p2smon.dll
    p2sodbc.dll
      

  2.   

    p2smon.dll
    在哪里。我的没找到呀
      

  3.   

    [email protected] 谢谢了,大哥你有水晶报表的相关资料的话也给我点。我没用过水晶报表,现在刚学。在就是那个怎么注册呀
      

  4.   

    使用报表先导——标准---创建新连接---ole db(ado)---Microsoft OLE DB  provider for sql server.... 以这种方式连接的。可在打包后装别的机子上,一直是提示。连接数据库失败//这个方式产生错误,不是打包的问题。
    就算你把用户机装了水晶报表也会有连接不上这个问题实际这是水晶报表本身带有的问题,水晶报表中间实际有个服务端进行连接,所以有注销服务器这样的方式是要求程序中间的连接和水晶报表中间的连接完全一样,这才能连接得上,否则就是错误的(水晶报表有记忆连接功能)唯一解决的办法是:使用自定义文件ttx去进行连接。
      

  5.   

    还是不行。请问为什么用“仅字段定义”创建ttx文件时。中文字段在水晶报表里时乱码