关于64bit位系统ODBC找不到的问题
时间:2011-01-08 来源:luoht
在VS工具中设置编译为X86:
通过程序创建ODBC数据源:
RegistryKey regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Wow6432Node").OpenSubKey("ODBC").OpenSubKey("ODBC.INI", true).CreateSubKey(dsn); string driverPath = GetDriverDllPath(); if (string.IsNullOrEmpty(driverPath)) { return false; } string tcpIP = string.Format("host={0};port={1}", serverIP, port); regKey.SetValue("AutoStop", "YES"); regKey.SetValue("Driver", driverPath); regKey.SetValue("CommLinks", "TCPIP{" + tcpIP + "}"); regKey.SetValue("Debug", "No"); regKey.SetValue("Compress", "No"); regKey.SetValue("DisableMultiRowFetch", "No"); regKey.SetValue("Description", description);
相关阅读 更多 +
排行榜 更多 +