delphi7中用dbexpress无法连接上MS SQL 2000!!!(100分)

  • 主题发起人 主题发起人 Del_run
  • 开始时间 开始时间
D

Del_run

Unregistered / Unconfirmed
GUEST, unregistred user!
测试检查连接时出现的问题对话框提示:<br>Failure to connect:SQL error; error mapping failed<br>---------------------------------------------------------- <br>设置应该没问题在<br>在dbxdriver.ini和bdconnections.ini中都检查过:<br><br><br>[dcsoft]<br>DriverName=MSSQL<br>HostName=. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'本地SQL服务器<br>DataBase=E:/MSSQL/sqldata/MSSQL/Data/tnerp.mdf &nbsp;'连接的数据库(直接用tnerp也不行,所以用了实际路径)<br>User_Name=sa<br>Password= &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'密码为空<br>BlobSize=-1<br>ErrorResourceFile=<br>LocaleCode=0000<br>MSSQL TransIsolation=ReadCommited<br>OS Authentication=False<br><br>-----------------------------------------------<br>郁闷非常补丁打了也没用!!望高手解决!
 
我这里也一样。
 
这问题好象碰到的人很多<br>dbexpress直接用oleddb来连接的<br>不需要其他中间过程<br>不知道为什么会这样<br>delphi7中已经全面支持了MSSQL
 
var<br> &nbsp;dbParams: TWideStrings;<br>...................................<br> &nbsp; &nbsp; &nbsp;with DMData.dbxConn do<br> &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp;Connected := False;<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams := TWideStringList.Create;<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('DriverName=MSSQL');<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('HostName=' + sHost);<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('Database=' + sDatabase);<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('User_Name=' + sUser);<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('Password=' + sPass);<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('BlobSize=-1');<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('ErrorResourceFile=');<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('LocaleCode=0000');<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('Interbase TransIsolation=ReadCommited');<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('OS Authentication=False');<br> &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Add('Prepare SQL=False');<br><br> &nbsp; &nbsp; &nbsp; &nbsp;Params := dbParams;<br> &nbsp; &nbsp; &nbsp; &nbsp;try<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Connected := True;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dbParams.Free;<br> &nbsp; &nbsp; &nbsp; &nbsp;except<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MsgBox('网络连接或数据环境设置不正确!' + #13#10 + '请检查网络连接和数据环境设置!', htError);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Application.Terminate;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Abort;<br> &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp;end;
 
这样不行啊
 
后退
顶部