掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
Report Error (ID:100028)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
もげさん 自分のPCの環境は。 開発環境 ・CrystalReport9 ・OSはWindowsXp サービスパック2 ・SQLServer2000 ODBCでアクセスしてます。 ・VB6.0 サービスパック4 持出管理システムという社内システムを作成しています。 コード上では、一度検索をかけた後プレビューボタンを押したときにCrystal Reportsを表示させる処理です。。 自分のPCからはエラーが出ませんが、Virtual PCにインストーラパッケージをコピーしてインストールして起動したら、「SQLサーバを開くことが出来ません」とエラーが出ます。。 コードです。。↓ 'レポート出力処理 Private Sub Preview(Optional ByVal ToWindow As Boolean = True) On Error GoTo Err_Preview_Click '宣言 Dim lngRecCnt As Integer Dim strSql As String Dim strWhere As String Dim strErrMsg As String Dim lngRtn As Long Dim blnCancel As Boolean Dim strWndTitle As String Dim strRptName As String Dim strWkTbl As String Dim blnFlgExpense As Boolean Dim i As String Dim j As String blnCancel = False 'マウスを砂時計に設定 Me.MousePointer = vbArrowHourglass '持出登録一覧 strSql = "select * From MochiListView " '最初にwhere句の始まりを格納 strWhere = " WHERE" If Trim(imtMochi.Text) <> "" Then strSql = strSql & strWhere & " 持出番号 = " & CInt(Trim(imtMochi.Text)) strWhere = " AND" End If If cmdMochimei.ListIndex > 0 Then strSql = strSql & strWhere & " 場所ID = " & CInt(cmdMochimei.ItemData(cmdMochimei.ListIndex)) strWhere = " AND" End If If cmdBihinmei.ListIndex > 0 Then strSql = strSql & strWhere & " 備品番号 = " & CInt(cmdBihinmei.ItemData(cmdBihinmei.ListIndex)) strWhere = " AND" End If If cmdSyain.ListIndex > 0 Then strSql = strSql & strWhere & " 社員ID = " & CInt(cmdSyain.ItemData(cmdSyain.ListIndex)) strWhere = " AND" End If If cmdKubun.ListIndex > 0 Then strSql = strSql & strWhere & " 区分ID = " & CInt(cmdKubun.ItemData(cmdKubun.ListIndex)) strWhere = " AND" End If If IsNull(imdMochidasi.Value) = False Then strSql = strSql & strWhere & " 持出日 >= '" & CDate(imdMochidasi.Value) & "'" strWhere = " AND" End If If IsNull(imdHenkyaku.Value) = False Then strSql = strSql & strWhere & " 返却完了日 <= '" & CDate(imdHenkyaku.Value) & "'" strWhere = " AND" End If If grd_mochi_list.Row <> 0 Then strSql = strSql & strWhere & " 持出番号 = " & grd_mochi_list.TextMatrix(grd_mochi_list.Row, 1) & strWhere & " 詳細番号 = " & grd_mochi_list.TextMatrix(grd_mochi_list.Row, 2) strWhere = " AND " End If 'Order strSql = strSql & " ORDER BY 持出番号 " '作業テーブル名 strRptName = ReportName blnFlgExpense = False ' --- レポート出力 --- m_strReportPath = App.Path 'レポートファイルへのパス設定 crReport.DiscardSavedData = True 'レポートに保存されているデータを破棄 crReport.ReportFileName = m_strReportPath & "\" & strRptName 'レポートファイルの場所を指定 crReport.WindowTitle = strWndTitle 'ウインドウのタイトル crReport.WindowState = crptMaximized 'ウインドウを最大化 crReport.WindowShowCloseBtn = True '閉じるボタンを表示 crReport.WindowShowExportBtn = False 'エクスポートボタンを非表示 crReport.WindowParentHandle = MN_Main.hwnd '親ウィンドウのハンドル crReport.Connect = "DSN = KENGO;UID = sa;PWD = kengo666;" crReport.SQLQuery = strSql If IsNull(imdMochidasi.Text) = False Then If IsNull(imdHenkyaku.Text) = False Then crReport.Formulas(0) = "持出日 = '" & imdMochidasi.Text & "'" crReport.Formulas(1) = "返却完了日 = '" & imdHenkyaku.Text & "'" End If End If If ToWindow = True Then 'レポートの出力先をウインドウに設定 crReport.Destination = crptToWindow Else '--- 印刷ダイアログを表示 --- On Error Resume Next cdlPrint.CancelError = True cdlPrint.ShowPrinter cdlPrint.PrinterDefault = True If Not Err.Number = cdlCancel Then 'レポートの出力先をプリンタに設定 crReport.Destination = crptToPrinter Else GoTo ExitProc End If End If On Error GoTo Err_Preview_Click 'レポートを表示 lngRtn = crReport.PrintReport 'エラーの有無を確認 If lngRtn <> 0 Then strErrMsg = crReport.LastErrorString 'エラー文字列を取得 Call MsgBox(strErrMsg, vbOKOnly + vbExclamation, "ReportError") End If crReport.SelectionFormula = "" ExitProc: 'マウスポインターを元に戻す Me.MousePointer = vbDefault Exit Sub Err_Preview_Click: Call ErrMsg End Sub インストーラは、Visual Studio Installeを使用してます。 いくつかタスク一覧に、説明エラー?が出てたのですがそれを取り除いてビルドをかけて、インストーラパッケージを作りました。。 配布している項目をのせておきます。 ①ファイルシステムのアプリケーションフォルダ calcx60.dll calndr60.ocx cont3d60.ocx craxddrt.dll レジストリに登録 craxdrt.dll レジストリに登録 crtslv.dll レジストリに登録 crviewer.dll レジストリに登録 crxf_rtf.dll crxlat32.dll cselexpt.ocx dao360.dll date60.ocx datex60.dll ExportModeller.dll レジストリに登録 finanx60.dll holyx60.dll imbase6.dll imshare6.dll レジストリに登録 mask60.ocx nmlite60.ocx number60.ocx p2bbnd.dll p2bxbse.dll P2lsql.dll p2sifmx.dll p2soledb.dll p2sora7.dll p2ssql.dll p2ssyb10.dll pg32conv.dll PR_Basyo.rpt PR_Bihin.rpt PR_Kubun.rpt PR_Mochi.rpt PR_Syain.rpt s2sqlprs.dll sscsdk80.dll text60.ocx レジストリに登録 time60.ocx todg6.ocx tzonex60.dll u252000.dll u25dts.dll u2dapp.dll u2ddisk.dll u2dmapi.dll u2dnotes.dll u2dpost.dll u2dvim.dll u2fcr.dll u2fhtml.dll u2fodbc.dll u2frec.dll u2fsepv.dll u2ftext.dll u2fwks.dll u2fxls.dll u2l2000.dll u2lcom.dll u2ldts.dll u2lsamp1.dll 持出管理システム.exe ②ファイルシステムのWindowsファルダ crpe32.dll crpe32_res_jp.dll crystl32.ocx レジストリに登録 implode.dll p2bdao.dll p2ctdao.dll p2irdao.dll p2ixbse.dll p2lodbc.dll p2smon.dll p2smon.dll p2sodbc.dll レジストリに登録 scrrnjp.dll scrrun.dll vb5db.dll そして、ユーザーのスタートメニューにインストーラを展開した後に作られる持出管理システムのショートカットがあります。。
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.