L
linyuansheng888
Unregistered / Unconfirmed
GUEST, unregistred user!
我的程序如下,但是我想修改几行程序,<br>让SQL SERVER应该如何验证登录ID的真伪?<br>这一项选择第二项使用用户输入登录ID和密码的SQL SERVER验证。<br>请问应该怎么修改?请高人不吝赐教<br>————————————————————————————————————————<br>unit showfrm;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, jpeg, ExtCtrls, StdCtrls,Registry;<br><br>type<br> Tshowfrom = class(TForm)<br> Image1: TImage;<br> Label1: TLabel;<br> Date_lb: TLabel;<br> Label2: TLabel;<br> procedure FormCreate(Sender: TObject);<br><br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> showfrom: Tshowfrom;<br><br>implementation<br>const databaseName='SaleSystem';<br>const ODBCName='lin0932';<br>const Aboutname='Client';<br><br><br>{$R *.dfm}<br><br>procedure Tshowfrom.FormCreate(Sender: TObject);<br>var registerTemp : TRegistry;<br>begin<br> Date_lb.Caption:='今天是'+datetostr(now)+' ';<br><br> begin<br> registerTemp := TRegistry.Create;<br> with registerTemp do<br> begin<br> RootKey:=HKEY_LOCAL_MACHINE;<br><br> if OpenKey('Software/ODBC/ODBC.INI/ODBC Data Sources',True) <br> then<br> begin<br> WriteString( ODBCName,'SQL Server');<br> end<br> else<br> begin<br> Application.MessageBox('连接ODBC数据源失败.','提示',64);<br> exit;<br> end;<br> CloseKey; <br><br> if OpenKey('Software/ODBC/ODBC.INI/'+ODBCName,True)<br> then<br> begin<br> WriteString( 'Database', databaseName);<br> WriteString( 'Description', Aboutname);<br> WriteString('Driver','c:/WINDOWS/system32/sqlsrv32.dll' );<br> Writestring('lastuser','sa');<br> Writestring( 'Server', '210.34.145.254');<br> Writestring( 'Pwd', '');<br> Writestring( 'Trusted_Connection', 'Yes' );<br> writestring('Exclusive','No');<br> writestring('Null','Yes');<br> writestring('SetNoCountOn','No');<br> writestring('ImplicitCommitSync','');<br><br><br><br> end<br> else<br> begin<br> Application.MessageBox('连接ODBC数据源失败.','提示',64);<br> exit;<br> end;<br> CloseKey;<br> Free;<br> end;<br> end;<br>end;<br><br><br><br>end.