在SQL Server 内查询Access 数据, 并将数据保存到SQL Server
-- OPENROWSET ACCESS 不能有密码, 有密码用OPENDATASOURCE
SELECT *
from OPENROWSET ('Microsoft.Jet.OLEDB.4.0',
'C:\temp\Test.mdb'; /*Access 数据库路径*/
'admin'; /*Access工作组密码*/
'',/*Access工作组密码*/
[AccessTableName])
1. 查询Access 表内所有数据
SELECT *
from OPENROWSET ('Microsoft.Jet.OLEDB.4.0',
'C:\temp\Test.mdb';
'admin';
'',
[AccessTableName])
2. 查询Access 表内 [ID] 在10 到 20 的所有数据
SELECT *
from OPENROWSET ('Microsoft.Jet.OLEDB.4.0',
'C:\temp\Test.mdb';
'admin';
'',
[AccessTableName])
where [ID] BETWEEN 10 AND 20
3. 查询Access 表内所有数据, 并将表(表结构和数据)保存到SQL Server 表A内(SQL Server 内 不存在表A)
SELECT *
into C
from OPENROWSET ('Microsoft.Jet.OLEDB.4.0',
'C:\temp\Test.mdb';
'admin';
'',
[AccessTableName])
4. 查询Access 表头, 并将表保存到SQL Server 表D内(SQL Server 内 不存在表D)
SELECT top(0)*
into D
from OPENROWSET ('Microsoft.Jet.OLEDB.4.0',
'C:\temp\Test.mdb';
' ......
需要用到的一个函数:
LONG SetWindowLong(
HWND hWnd,
int nIndex,
LONG dwNewLong
);
其中nIndex GWL_EXSTYLE Retrieves the extended window styles.
dwNewLong WS_EX_TOOLWINDOW Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE.
有关dwNewLong的更多预定义值的含义,请自行查阅CreateWindowEx的帮助信息
在窗体创建事件中加入:
SetWindowLong(Application.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);
如果要整个程序不在任务栏显示,可以在dpr工程文件中加入以上代码,例如:(需要引用Windows单元)
begin
Application ......
浏览器:IE 8、FF 3.6、Chrome 4.0、Safari 4.0、Opera 10.1
仅有IE浏览器支持HTMLElement.onresize(比如body.onresize)
其它浏览器只支持window.onresize
先说IE的HTMLElement.onresize
使用前请确定你的心脏及血压正常,如果你定义了
body.onresize = function(){……}或者html.onresize = obj.fun;
你猜猜this指针是谁?不是body,不是html,不是obj,而是window!
这样清况下如果:
function fun(){
……
};
html.onresize = fun;
body.onresize = fun;
document.getElementById("id").onresize = fun;
以上代码完全可用,只是fun执行时,你根本不知道是哪个元素激发的。什么?你说event对像里会不会有激发的元素?肯定的说:没有!
好了,我们放轻松,没办法就没办法吧。大不了我就不管是谁激发的全都处理一遍。不过还是先看下面的代码:
function addresize(element){
element.onresize = function(){
……
};
};
addresize(body);
addresize(html);
addresize(#id);
你猜猜在onresize执行时的this是谁?别想了,还是window!
灵异的事情发生了,在省略号的代码中你可以使用elem ......
选择元素:document.getElementsByTagName,document.getElementsById,document.getElementsByName。
firstChild,lastChild,nextSibling,previousSibling
创建元素:document.createElement(),appendChild();
删除元素:removeChild();
实例:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<style>
.txt{ color:Red; border:solid 1px #ff0000}
</style>
<script type="text/javascript">
function chElement()
{
var txtAry=document.getEleme ......
-- get all dictionary for oracle db
select * from dict;
--select * from dictionary;
-- get all columns for dictionarys
select * from dict_columns;
-- get the default name-space for current user
select username,default_tablespace from user_users;
-- get roles for current user
select * from user_role_privs;
-- get system privilage and table privilage for current user
select * from user_sys_privs;
select * from user_tab_privs;
-- get all tables for current user
select * from user_tables;
-- get all tables whoes name includes log
select object_name,object_id from user_objects where instr(object_name,'LOG')>0
-- get the create date for a table
select object_name,created from user_objects where object_name=upper('&table_name');
-- get the size for the given table
select sum(bytes)/(1024*1024) as "size(M)" from user_segments where segment_name=upper('&table_name');
-- get tables in ram
select table_name,cache from user_tables where instr(cache,'Y')>0
-- ......
alter system kill session'50,492';
--以下几个为相关表
SELECT * from v$lock;
SELECT * from v$sqlarea;
SELECT * from v$session;
SELECT * from v$process ;
SELECT * from v$locked_object;
SELECT * from all_objects;
SELECT * from v$session_wait;
--1.查出锁定object的session的信息以及被锁定的object名
SELECT l.session_id sid, s.serial#, l.locked_mode,l.oracle_username,
l.os_user_name,s.machine, s.terminal, o.object_name, s.logon_time
from v$locked_object l, all_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
ORDER BY sid, s.serial# ;
--2.查出锁定表的session的sid, serial#,os_user_name, machine name, terminal和执行的语句
--比上面那段多出sql_text和action
SELECT l.session_id sid, s.serial#, l.locked_mode, l.oracle_username, s.user#,
l.os_user_name,s.machine, s.terminal,a.sql_text, a.action&n ......