易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi Excel to Sql Server

 unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB,comobj, OleServer,
  ExcelXP;
type
  TForm1 = class(TForm)
    ADOConn: TADOConnection;
    atblXlsToSql: TADOTable;
    DBGrid1: TDBGrid;
    Panel1: TPanel;
    Button1: TButton;
    opdExcel: TOpenDialog;
    DataSource1: TDataSource;
    Excel: TExcelApplication;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
    function ConnectDB:boolean;              //连接数据库
    function  OpenTable(const Tablename:String):boolean;   //打开指定数据表
    function  XlsToSqlTable(const xlsFileName,TableName:String):boolean;  //将Excel数据导入Sql Server
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
  serverIP,dbName,userid,passw:string;  //服务器IP,数据库名称,用户名,密码
implementation
{$R *.dfm}
function TForm1.ConnectDB:boolean;
begin
  Result:=false;
  serverIP:='192.168.0.0';
  dbName:='OnLine';
  userid:='sa';
  passw:='sa';
  if not adoconn.Connected then
  begin
    adoconn.ConnectionString:='Provider=SQLOLEDB.1;Password=' + passw
                            + ';Persist Security Info=True;User ID=' + userid
                            + ';Initial Ca


相关文档:

Delphi编译指令说明

《Delphi下深入Windows核心编程》(附录A Delphi编译指令说明)
摘抄人:麻子 qq:71892967
Delphi快速高小的编译器主要来自Object PASCAL的严谨,使用Delphi随时都在与编译器交流,大部分情况下不需要干涉编译器的运行,但是有时也需要对编译器进行必要的设置。
*************************************************** ......

sql server查询数据库中包含指定字符串的数据表

 发布一个实用小工具,可以很方便的在数据库中找到包含指定字符串的数据表名及相应记录:
/*
功能:查询数据库中包含指定字符串的数据表名及相应记录
作者:陈加鹏 chjpeng#163.com
日期:2009-08-17
*/
declare @key varchar(30)
set @key = 'test'    --替换为要查找的字符串
DECLARE @ ......

整理比较全的Access SQL注入参考

 Access SQL注入参考
版本 0.2.1
(最近更新 10/10/2007)
原作者不详
 
描述 SQL查询及注释
注释符 Access中没有专门的注释符号.因此"/*", "--"和"#"都没法使用.但是可以使用空字符"NULL"(%00)代替:
' UNION SELECT 1,1,1 from validTableName%00
 
语法错误信息 "[Microsoft][Driver ODBC Micros ......

SQL 先筛选在关联的例子

select ID,Item1,Item2,Item3,Item4
into #Temp
from (
select ID='200910',Item1='A',Item2='B',Item3='C',Item4='T1'
union all
select ID='200910',Item1='',Item2='B',Item3='C' ,Item4='G2'
union all
select ID='200910',Item1='A',Item2='D',Item3='C' ,Item4='T3'
union all
select ID='200910',Item ......

SQL SERVER 参考:游标(Cursor)的讲解与实例

 
在数据库中,游标是一个十分重要的概念。游标提供了一种对从表中检索出的数据进行操作的灵活手段,就本质而言,游标实际上是一种能从包括多条数据记录的结果集中每次提取一条记录的机制。游标总是与一条T_SQL 选择语句相关联,因为游标由结果集(可以是零条、一条或由相关的选择语句检索出的多条记录)和结果集中指 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号