有三种可能:
(1)如果你是用bde,则驱动不应该是ora73.dll,应该是oci.dll
(2)配置hoststring时使用的是sid,而不是service_name
(3)你的tns配置不正确,你在看一下服务器的service_name
(1)如果你是用bde,则驱动不应该是ora73.dll,应该是oci.dll
(2)配置hoststring时使用的是sid,而不是service_name
(3)你的tns配置不正确,你在看一下服务器的service_name
这是我的连接字符串,你可以看一下// Result := 'Provider=MSDAORA.1;Password=' + Password + ';Persist Security Info=True;User ID=' + UserName + ';Data Source='+ServerName+';Extended Properties=""';
Result := 'Provider=OraOLEDB.Oracle.1;Password=' + Password + ';Persist Security Info=True;User ID=' + UserName + ';Data Source='+ServerName+';Extended Properties=""';前面一种用的是MS的OLE DB FOR ORACLE
后面一种用的是ORACLE 自带的OLE DB 驱动
先测试一下你的odbc是否连接正常。