1
伊夫遷移站點從舊服務器到新的Windows Server 2012但是我沒有收到此錯誤信息.NET MySQL的ODBC驅動程序問題
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Line 138: OdbcCon.Open();
我的代碼是
string sql = "SELECT files.file_id,files.file_name,files.size,files.date_added,users.title,users.forename,users.surname FROM files LEFT JOIN users ON files.upload_id = users.user_id WHERE files.owner_id IN(" + Request.QueryString["currentFiles"].ToString() + ") AND files.date_added >= '2012-01-01 00:00:00' " + orderBy;
ConStr = "DRIVER={MySQL ODBC 5.2 ANSI Driver};" + "SERVER=serverip;" + "DATABASE=dbname;" + "UID=pfdownload;" + "PASSWORD=password" + "OPTION=3";
OdbcCon = new System.Data.Odbc.OdbcConnection(ConStr);
OdbcCom = new System.Data.Odbc.OdbcCommand(sql, OdbcCon);
OdbcCon.Open();
我已經安裝了「mysql-connector-odbc-5.2.6-win32.msi」
有沒有人有任何線索?
淨化你的投入,男人做到這一點! http://xkcd.com/327/ – abitgone
只是爲了測試ODBC驅動程序,您可以嘗試使用mysql驅動程序和此實用程序創建ODBC數據源'%windir%\ system32 \ odbcad32.exe'如果您在創建連接並測試它,然後問題來自你的connectionString – Sidewinder94