Dim i As Integer '定義整型變數Public Sub tree_change() '定義添加樹狀列表的函數 Dim key, text, bh As String 'Dim nod As Node Adodc1.RecordSource = "select * from 商品基礎資訊表 order by 商品編號" Adodc1.Refresh If Adodc1.Recordset.RecordCount > 0 Then
--> Title : 查每個地區前N條記錄 假如3--> Author : wufeng4552--> Date : 2009-11-02 if object_id('test')is not null drop table testgocreate table test(ID int identity,areaid int,score int)insert into test select 0,10union all select 0,20union all
-->Title:Generating test data-->Author:wufeng4552-->Date :2009-10-01 15:16:26if object_id('tb')is not null drop table tbgocreate table tb(ID int ,[name] varchar(10))insert tb select 1,'A' union all select 3,'B' union all
-->Title:刪除資料庫裡某個使用者所有表裡的資料-->Author:wufeng4552-->Date :2009-09-21 15:08:41--方法1declare @uname varchar(20)declare cuser cursor for select so.namefrom sysobjects so,sysusers su where so.uid=su.uid and su.name='Stone'and so.xtype='U'open
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_IP2Int]') and xtype in (N'FN', N'IF', N'TF'))drop function [dbo].[f_IP2Int]GO--1. 字串IP地址轉換成IP數值函數。CREATE FUNCTION dbo.f_IP2Int(@ip char(15))RETURNS bigintASBEGINDECLARE @re
IF OBJECT_ID('TB')IS NOT NULL DROP TABLE TBGOCREATE TABLE tb (ID INT IDENTITY(1,1),VALUE NVARCHAR(100))INSERT tb SELECT N'中國'UNION ALL SELECT N'中國人'UNION ALL SELECT N'中國人民'UNION ALL SELECT N'日本'UNION ALL SELECT N'日本人'UNION ALL SELECT
-->Title:Generating test data-->Author:wufeng4552-->Date :2009-09-28 08:52:38if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_getdate]') and xtype in (N'FN', N'IF', N'TF'))drop function [dbo].[f_getdate]GOcreate
-->Title:產生測試數據-->Author:wufeng4552-->Date :2009-09-21 09:02:08--unicode從19968到40868if object_id('dbo.get_china_str')is not null drop function dbo.get_china_strgocreate function dbo.get_china_str( @str nvarchar(200))returns