出来るのだASP Q&A掲示板(過去LOG)
訪問数 52046
昨日 889
今日 776 【PR】 パソコン入門からIT専門書まで幅広く取り揃えています。セブン-イレブン受取り手数料無料のセブンアンドワイ。 |
![]() ![]() ![]() ![]() ![]() |
[5332] CSVファイルインポート |
投稿者:ひろのしまさん の <ホームページ> 2005/10/15 22:34:00 |
ASPの下手の横好きなものです。質問いたします。ASP経験が中途半端な男です。 使用環境:Windows XP Professional Office XP(Access2002) IIS 5 C:\Inetpub\wwwroot\ASP_ProfileEdition\InputFile\ 上記フォルダにある、ProfileEdition_20050715.csv というCSV形式のファイルを、 C:\Inetpub\database\ProfileEdition.mdb の"履歴書"テーブルにでインポートしたいのですが、別サイトで見つけた下記のようなサンプルコードを何とか組み合わせて やりたいのですが、エラーメッセージが出てしまい、うまく行きません。 <% //***************サンプルコード***************// sCoString = "DBQ=" & Server.MapPath("./sample.mdb") & ";" sCoString = sCoString & "DefaultDir=" & Server.MapPath("./") & ";" sCoString = sCoString & "Driver={Microsoft Access Driver (*.mdb)};DriverId=25;" Set cn = Server.CreateObject("ADODB.Connection") cn.Open sCoString sSQL = "SELECT * INTO test FROM [TEXT;DATABASE=C:\mdb].[test.csv]" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSQL, cn, 3, 3, 1 set rs = nothing set cn = nothing %> 上記コードを拝借して、 <% //*****************自分が加え記入したコード*****************// sCoString = "DBQ=C:\Inetpub\database\ProfileEdition.mdb;" sCoString = sCoString & "DefaultDir=C:\Inetpub\database\;" sCoString = sCoString & "Driver={Microsoft Access Driver (*.mdb)};DriverId=25;" Set cn = Server.CreateObject("ADODB.Connection") cn.Open sCoString sSQL = "SELECT * INTO 履歴書 FROM [TEXT;DATABASE=C:\Inetpub\database\ProfileEdition.mdb].[ProfileEdition_20050715.csv]" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSQL, cn, 3, 3, 1 set rs = nothing set cn = nothing %> のように設定すると、 エラー タイプ Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] パス 'C:\Inetpub\database\ProfileEdition.mdb' は正しくありません。 パス名に間違いがないことと、ファイルが置かれたサーバーに接続していることを確認してください。 /ASP_ProfileEdition/CSVインポート.asp, line 11 のようなエラーメッセージが出てしまいます。使用しているデータベースは、IISの管理ツール以降の設定において接続の設定は 行っております。どうかよきアドバイスをお願いします。 |
![]() ![]() |
![]() ![]() ![]() |
TreeBBS For ASP V.0.1.3 |