DelphiʹÓÃiniÅäÖÃÎļþÁ¬½ÓMS SQLÊý¾Ý¿â
ºÜÔç×ö¹ýµÄÒ»¸ödelphiÏîÄ¿£¬°ÑÀïÃæÓõ½µÄ¼¼Êõ×ܽáһϣ¬Ö÷ÒªÊÇÕë¶ÔÏóÎÒÕâÑùµÄdelphiÐÂÊÖ£¬¼¼ÊõÉÏ×ö¸ö»ýÀÛ°É£¡
¼ÙÉèÎÒÃǵÄÊý¾Ý¿âÅäÖÃÎļþServerInfo.iniÄÚÈÝÈçÏ£º
[ServerInfo]
ServerIP=192.168.1.5
SQLDBName=Data
SQLUserID=sa
SQLPwd=
ÎÒÃǶ¨ÒåÒ»¸öÁ¬½ÓÊý¾Ý¿âµÄ¹ý³ÌDBConnectÄÚÈÝÓ¦ÈçÏÂ
procedure TDM.DBConnect();
var
ini:TiniFile;
Server,User,Pass,DBName:string;
begin
ini := TiniFile.Create(ExtractFilePath(Application.ExeName)+'dbconn.ini'); //³õʼ»¯iniÎļþ
Server := ini.ReadString('serverinfo','ServerIP',''); //Êý¾Ý¿âipµØÖ·
DBName := ini.ReadString('serverinfo','SQLDBName',''); //Êý¾Ý¿âÃû
User := ini.ReadString('serverinfo','SQLUserID',''); //Êý¾Ý¿âÓû§Ãû
Pass := ini.ReadString('serverinfo','SQLPwd',''); //Êý¾Ý¿âÃÜÂë
try
DM.ADOConn.ConnectionString := 'Provider=SQLOLEDB.1;Persist Security Info=False;'
+'User ID='+trim(User)
+';Password='+trim(Pass)
+';Initial Catalog='+trim(DB)
+';Data Source='+trim(Server);
DM.ADOConn.Open ;
except
application.MessageBox('Êý¾Ý¿âÁ¬½Óʧ°Ü£¬Çë¼ì²éINIÅäÖÃÎļþ','Ìáʾ',64);
application.Terminate ;
end;
end;
ÏàÐÅ´ó¼Ò¶¼ÄÜ¿´¶®£¬×¢ÒâʹÓÃTiniFileÀàµÄº¯Êý»ò¹ý³ÌÓ¦ÒýÈëINIFilesµ¥Ôª¡£
Ïà¹ØÎĵµ£º
ÎÒ°²×°µÄÊÇsql server 2000ËĺÏÒ»°æ±¾£¬Õý³£Í¾¾¶Ö±½Ó°²×°ÊÇ×°²»Éϵģ¬Òª´òʲôSP3²¹¶¡£¬²»ÒªÀíËü£¬´ò¿ª°²×°°ü£¬Àï±ßÓиöMSDEĿ¼£¬Ö´ÐÐsetup.exe£¬°²×°ºÜ˳Àû£¬×°ÍêÖ®ºóÊÇûÓз´Ó¦µÄ£¬ÖØÆô¼ÆËã»ú£¬È»ºóÄÜ¿´µ½sql server·þÎñÒѾÆô¶¯£¬ÕâÑù£¬¾Í¿ÉÒÔÕý³£°²×°ÁË£¬Ö´Ðа²×°°ü¸ùĿ¼Ïµİ²×°³ÌÐò£¬°´Ìáʾһ²½ ......
ÍêÈ«±¸·Ý»òÈÕÖ¾±¸·ÝËä˵¶¼ÓнضÏÈÕÖ¾µÄ¹¦ÄÜ,µ«ÊDz»»áÊÕËõÈÕÖ¾ÎļþµÄ¿Õ¼ä·µ»Ø¸ø²Ù×÷ϵͳ.
Èç¹ûÄãÏ뽫ÈÕÖ¾ÎļþµÄ¿Õ¼ä·µ»Ø¸ø²Ù×÷ϵͳµÄ»°,Ö»ÓÐÒ»ÖÖ·½·¨,¾ÍÊÇÊÕËõÊý¾Ý¿â(Ñ¡ÔñÈÕÖ¾Îļþ)
ZTÒ»¸öÏà¹ØÌû×Ó,¹©²Î¿¼!
ÎïÀíÈÕÖ¾Îļþ£º
Õâ¸ö±È½ÏºÃÀí½â£¬ÊµÊµÔÚÔڵĶ«Î÷£¬Êý¾Ý¿âĿ¼ÏÂÃæµÄ.ldfÎļþ¾ÍÊÇ£¬ÓÐЩÈËϲ»¶¸Äºó ......
Êý¾Ý¿âÃæÊÔ³£ÓòâÊÔÌâ(SQL Server)
ÌâÄ¿1
¡¡¡¡ÎÊÌâÃèÊö:
¡¡¡¡Îª¹ÜÀí¸ÚλҵÎñÅàѵÐÅÏ¢£¬½¨Á¢3¸ö±í:
¡¡¡¡S (S#,SN,SD,SA) S#,SN,SD,SA ·Ö±ð´ú±íѧºÅ¡¢Ñ§Ô±ÐÕÃû¡¢ËùÊôµ¥Î»¡¢Ñ§Ô±ÄêÁä
¡¡¡¡C (C#,CN ) C#,CN ·Ö±ð´ú±í¿Î³Ì±àºÅ¡¢¿Î³ÌÃû³Æ
¡¡¡¡SC ( S#,C#,G ) S#,C#,G ·Ö±ð´ú±íѧºÅ¡¢ËùÑ¡Ð޵Ŀγ̱àºÅ¡¢Ñ§Ï°³É¼¨
¡¡¡¡1. Ê¹Ó ......
----------------------------------------------------------------------
1¡¢SQLÊý¾Ý¿â»Ö¸´Ä£ÐÍ
----------------------------------------------------------------------
1£©ÍêÈ«»Ö¸´Ä£ÐÍ
-----------------
£¨1£©±¸·ÝʱҪ±¸·ÝÊý¾Ý¿âµÄÊý¾ÝÎļþºÍÈÕÖ¾Îļþ
£¨2£©»¹ÔʱʹÓÃÊý¾Ý¿âµÄ±¸·ÝµÄÊý¾ÝÎļþ¸±±¾ºÍÈ«²¿ÈÕÖ¾ÐÅ ......