在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
序言
For uses SysUtils; var i:integer; begin for i:=1 to 10 do begin Writeln(i); end; Readln; end. Delphi用字符串连接MSSQLERVER 控制台连接Sql Server数据库 uses ADOdb,ActiveX; var conMain : TADOConnection; tab1 : TADOTable; begin CoInitialize(nil); conMain := TADOConnection.Create(nil); tab1 := TADOTable.Create(nil); conMain.ConnectionString := 'Provider=SQLOLEDB.1;Password=xx;Persist Security Info=True;User ID=sa;Initial Catalog=xx;Data Source=127.0.0.1'; conMain.LoginPrompt := False; conMain.Open; tab1.Connection := conMain; tab1.TableName := 'CASTAFF'; tab1.Active := True; tab1.Recordset.MoveFirst; while not tab1.Recordset.EOF do begin writeln(tab1.Recordset.Fields[2].Value); tab1.Recordset.MoveNext; end; CoUninitialize; Readln; end. TADOConnection 资料https://blog.51cto.com/mslagee/558806 https://www.ixigua.com/6773433817253282315?id=6772498388131774980&logTag=9e852d7bd255becbcf5b |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论