锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品免费福利,国产传媒在线,成人影视在线播放http://www.aygfsteel.com/hwpok/category/49633.htmlDEBUG - 澶╅亾閰嫟zh-cnTue, 08 Jul 2014 09:37:12 GMTTue, 08 Jul 2014 09:37:12 GMT60excel2pdmhttp://www.aygfsteel.com/hwpok/archive/2014/07/06/415501.html鎯犱竾楣?/dc:creator>鎯犱竾楣?/author>Sun, 06 Jul 2014 13:06:00 GMThttp://www.aygfsteel.com/hwpok/archive/2014/07/06/415501.htmlhttp://www.aygfsteel.com/hwpok/comments/415501.htmlhttp://www.aygfsteel.com/hwpok/archive/2014/07/06/415501.html#Feedback0http://www.aygfsteel.com/hwpok/comments/commentRss/415501.htmlhttp://www.aygfsteel.com/hwpok/services/trackbacks/415501.html
'******************************************************************************
'
* File:     excel2pdm.txt
'
* Title:    pdm export to excel
'
* Purpose:  To export the tables and columns to Excel
'
* Model:    Physical Data Model
'
* Objects:  Table, Column, View
'
* Author:   ziyan
'
* Created:  2012-05-03
'
*Modifier:  Hui Wanpeng 2014/07/04
'
* Version:  1.0
'
******************************************************************************
Option Explicit

Dim md1 'the current model
Set md1=ActiveModel
If(md1 Is NothingThen
  
MsgBox "There is no Active Model"
End If

Dim HaveExcel
Dim RQ
RQ 
= vbYes 'MsgBox("Is Excel Installed on your machine?",vbYesNo+vbInformation,"Confirmation")

If RQ=vbYes Then
  HaveExcel
=True
  
'Open&Create Excel Document
  Dim x1
  
set x1=CreateObject("Excel.Application")
  x1.Workbooks.Open 
"E:/tmp/B瓚呮鏌ヨ〃.xls"
  x1.Workbooks(
1).Worksheets("Sheet1").Activate
Else
  HaveExcel
=False
End If

process x1, md1

sub process(x1,md1)
    
dim rwIndex
    
dim tableName
    
dim colname
    
dim table
    
dim col
    
dim count
    
dim dType
    
dim nNull

    
'on error Resume Next
    For rwIndex =1 To 500 step 1
       
With x1.Workbooks(1).Worksheets("Sheet1")
          
If .Cells(rwIndex,1).Value="" Then
             
Exit For
          
End If
          
If .Cells(rwIndex,3).Value="" Then
              
set table=md1.Tables.CreateNew
              table.Name
=.Cells(rwIndex,2).Value
              table.Code
=UCase(.Cells(rwIndex,1).Value)
              table.Comment
=.Cells(rwIndex,2).Value
              count
=count+1
          
Else
              colName
=.Cells(rwIndex,1).Value
              
set col=table.Columns.CreateNew
              
              
'MsgBox.Cells(rwIndex,1).Value
               'MsgBox colName,vbOK+vbInformation,"鍒?
              col.Code=Trim(UCase(.Cells(rwIndex,1).Value))
              col.Name
=Trim(UCase( .Cells(rwIndex,1).Value))
              col.Comment
=Trim(.Cells(rwIndex,2).Value)
           
              dType
=Trim(UCase(.Cells(rwIndex,3).Value))
              
'MsgBox Left(dType, 5)
              If Left(dType, 5)="CHAR(" Then
                  dType
=Replace(dType,"CHAR","VARCHAR2")
              
ElseIf Left(dType, 5)="CAHR(" Then 
                  dType
=Replace(dType,"CAHR","VARCHAR2")
              
End If
              col.DataType
=dType
           
              nNull
=Trim(UCase(.Cells(rwIndex,4).Value))
              
If nNull="NOT NULL" then
                col.Mandatory
="true"
              
End If
           
         
End If
       
End With
    
Next

    
MsgBox "鐢熸垚鏁版嵁琛ㄧ粨鏋勫叡璁?nbsp;" + CStr(count), vbOK+vbInformation, "琛?/span>"
    x1.Workbooks.Close
    
Exit Sub

End Sub




]]>
vb 鎵樼洏http://www.aygfsteel.com/hwpok/archive/2013/08/01/402247.html鎯犱竾楣?/dc:creator>鎯犱竾楣?/author>Thu, 01 Aug 2013 03:21:00 GMThttp://www.aygfsteel.com/hwpok/archive/2013/08/01/402247.htmlhttp://www.aygfsteel.com/hwpok/comments/402247.htmlhttp://www.aygfsteel.com/hwpok/archive/2013/08/01/402247.html#Feedback0http://www.aygfsteel.com/hwpok/comments/commentRss/402247.htmlhttp://www.aygfsteel.com/hwpok/services/trackbacks/402247.htmlOption Explicit

Public Const MAX_TOOLTIP As Integer = 64
Public Const NIF_ICON = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_TIP = &H4
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_RBUTTONDBLCLK = &H206

Public Const SW_RESTORE = 9
Public Const SW_HIDE = 0

Public nfIconData As NOTIFYICONDATA


Public Type NOTIFYICONDATA
cbSize 
As Long
hWnd 
As Long
uID 
As Long
uFlags 
As Long
uCallbackMessage 
As Long
hIcon 
As Long
szTip 
As String * MAX_TOOLTIP
End Type

Public Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As LongAs Long
Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long


Private Sub Form_Load()
    
If App.PrevInstance Then
         
End ' 閫鍑烘柊榪愯鐨勭▼搴?/span>
    End If
    Me.Caption 
= "鎴戠殑絎竴涓▼搴?/span>"
    
'浠ヤ笅鎶婄▼搴忔斁鍏ystem Tray====================================System Tray Begin
With nfIconData
.hWnd 
= Me.hWnd
.uID 
= Me.Icon
.uFlags 
= NIF_ICON Or NIF_MESSAGE Or NIF_TIP
.uCallbackMessage 
= WM_MOUSEMOVE
.hIcon 
= Me.Icon.Handle
'瀹氫箟榧犳爣縐誨姩鍒版墭鐩樹笂鏃舵樉紺虹殑Tip
.szTip = App.Title + "(鐗堟湰 " & App.Major & "." & App.Minor & "." & App.Revision & ")" & vbNullChar
.cbSize 
= Len(nfIconData)
End With
Call Shell_NotifyIcon(NIM_ADD, nfIconData)
'=============================================================System Tray End
Me.Show
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lMsg As Single
lMsg 
= X / Screen.TwipsPerPixelX
Select Case lMsg
Case WM_LBUTTONUP
'MsgBox "璇風敤榧犳爣鍙抽敭鐐瑰嚮鍥炬爣!", vbInformation, "瀹炴椂鎾煶涓撳"
'
鍗曞嚮宸﹂敭錛屾樉紺虹獥浣?/span>
Timer1.Enabled = False
Call ShowWindow(Me.hWnd, SW_RESTORE)

'涓嬮潰涓ゅ彞鐨勭洰鐨勬槸鎶婄獥鍙f樉紺哄湪紿楀彛鏈欏跺眰
Me.Show
Me.SetFocus
'' Case WM_RBUTTONUP
'
'   PopupMenu MenuTray '濡傛灉鏄湪緋葷粺Tray鍥炬爣涓婄偣鍙抽敭錛屽垯寮瑰嚭鑿滃崟MenuTray
'
' Case WM_MOUSEMOVE
'
' Case WM_LBUTTONDOWN
'
' Case WM_LBUTTONDBLCLK
'
' Case WM_RBUTTONDOWN
'
' Case WM_RBUTTONDBLCLK
'
' Case Else
End Select
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    
Call Shell_NotifyIcon(NIM_DELETE, nfIconData)
End Sub

Private Sub Form_Resize()
    
If Me.WindowState = 1 Then
        Me.Hide
    
End If
End Sub

Private Sub leftBtn_Click()
    Static b1 
As Boolean     '瀹氫箟涓涓竷灝斿瀷鍙橀噺鐢ㄤ簬寮鍏充綔鐢?/span>
    b1 = Not b1
    Timer1.Enabled 
= b1     '鐢═imer1鏉ユ帶鍒跺浘鏍囩殑闂儊
    If Not b1 Then
        leftBtn.Caption 
= "寮濮?/span>"
    
Else
        leftBtn.Caption 
= "鍋滄"
    
End If
End Sub

Private Sub rightBtn_Click()
    infoLabel.Caption 
= "鍙寵竟鎸夐挳"
End Sub

Private Sub Timer1_Timer()
  Static b2 
As Boolean   ' 瀹氫箟涓涓竷灝斿瀷鍙橀噺鐢ㄤ簬寮鍏充綔鐢紝褰撲負True鏃舵墭鐩樺浘鏍囦負Picture2鍥劇墖錛屼負False鏃朵負Picture1鐨勫浘鐗?/span>
  b2 = Not b2
  
If b2 Then
        nfIconData.hIcon 
= Image1.Picture     '鎵樼洏鍥炬爣涓篜icture2鐨勫浘鐗?/span>
         infoLabel.Caption = "b"
  
Else
        nfIconData.hIcon 
= Image2.Picture       '鎵樼洏鍥炬爣涓篜icture1鐨勫浘鐗?/span>
        infoLabel.Caption = "a"
  
End If
   
Call Shell_NotifyIcon(NIM_MODIFY, nfIconData)     '淇敼鎵樼洏鍥炬爣


End Sub


]]>
VBA 鑷畾涔夊嚱鏁?/title><link>http://www.aygfsteel.com/hwpok/archive/2011/09/17/358874.html</link><dc:creator>鎯犱竾楣?/dc:creator><author>鎯犱竾楣?/author><pubDate>Sat, 17 Sep 2011 10:25:00 GMT</pubDate><guid>http://www.aygfsteel.com/hwpok/archive/2011/09/17/358874.html</guid><wfw:comment>http://www.aygfsteel.com/hwpok/comments/358874.html</wfw:comment><comments>http://www.aygfsteel.com/hwpok/archive/2011/09/17/358874.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/hwpok/comments/commentRss/358874.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/hwpok/services/trackbacks/358874.html</trackback:ping><description><![CDATA[<div><img border="0" alt="" src="http://www.aygfsteel.com/images/blogjava_net/hwpok/defineFunction.jpg" width="946" height="500" /></div><img src ="http://www.aygfsteel.com/hwpok/aggbug/358874.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/hwpok/" target="_blank">鎯犱竾楣?/a> 2011-09-17 18:25 <a href="http://www.aygfsteel.com/hwpok/archive/2011/09/17/358874.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>(鍘熷垱) VBA 浠g爜鐨勪繚鎶?/title><link>http://www.aygfsteel.com/hwpok/archive/2011/09/17/358861.html</link><dc:creator>鎯犱竾楣?/dc:creator><author>鎯犱竾楣?/author><pubDate>Sat, 17 Sep 2011 04:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/hwpok/archive/2011/09/17/358861.html</guid><wfw:comment>http://www.aygfsteel.com/hwpok/comments/358861.html</wfw:comment><comments>http://www.aygfsteel.com/hwpok/archive/2011/09/17/358861.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/hwpok/comments/commentRss/358861.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/hwpok/services/trackbacks/358861.html</trackback:ping><description><![CDATA[<div>1.鏈綆鍗曠殑鏂規硶灝辨槸瀵筕BA宸ョ▼鍔犲瘑<br />姝ラ濡備笅:<br />   1).鍦╒BA宸ョ▼涓婂乏鍙?浼氬嚭鐜板涓嬭彍鍗?<br />    <img border="0" alt="" src="http://www.aygfsteel.com/images/blogjava_net/hwpok/protect_menu.jpg" width="333" height="297" /><br />   2)閫変腑VBA欏圭洰灞炴?浼氬脊鍑哄涓嬭彍鍗?br />   <img border="0" alt="" src="http://www.aygfsteel.com/images/blogjava_net/hwpok/password.jpg" width="418" height="329" /> <br /><br />2.鑸嶅純鎴栭儴鍒嗚垗寮冨唴緗甐BA浠g爜,鏀圭敤澶栫疆鎻掍歡,濡?DLL,XLA 絳変唬鏇?VBA.<br /><br />3.鍦╒BA涓鍏ヨ爼铏垨鏈ㄩ┈浠ュ強鑷潃寮忎唬鐮?鍙嶈窡韙垨鐮村潖,VBA 鑰岃揪鍒扮帀鐭充勘鐒氱殑鏁堟灉,浠庤屼繚鎶?VBA!<br />   <br />4.鎬葷粨<br />   絎?縐嶅姞瀵嗙爜鐨勫畨鍏ㄦц緝浣?鍙兘闃繪尅瀵圭▼搴忎笉澶簡瑙g殑鍒濈駭鐢ㄦ埛.<br />   絎?縐嶆柟娉曡緝濂?DLL璁╀竴鑸腑綰х▼搴忓紑鍙戣呴兘鏈夌偣鏈涜岀敓鐣?<br />   絎?榪欎釜鏂規硶鍚搗鏉ユ湁浜涚巹,鎼炰笉濂?浼氳鑷繁鐢佃剳涓瘨, 娌℃湁璇曡繃.<br /></div> <img src ="http://www.aygfsteel.com/hwpok/aggbug/358861.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/hwpok/" target="_blank">鎯犱竾楣?/a> 2011-09-17 12:30 <a href="http://www.aygfsteel.com/hwpok/archive/2011/09/17/358861.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>(鍘熷垱) VBA-Testhttp://www.aygfsteel.com/hwpok/archive/2011/09/17/358843.html鎯犱竾楣?/dc:creator>鎯犱竾楣?/author>Fri, 16 Sep 2011 16:43:00 GMThttp://www.aygfsteel.com/hwpok/archive/2011/09/17/358843.htmlhttp://www.aygfsteel.com/hwpok/comments/358843.htmlhttp://www.aygfsteel.com/hwpok/archive/2011/09/17/358843.html#Feedback0http://www.aygfsteel.com/hwpok/comments/commentRss/358843.htmlhttp://www.aygfsteel.com/hwpok/services/trackbacks/358843.html
VERSION 1.0 CLASS
BEGIN
  MultiUse 
= -1  'True
END
Attribute VB_Name 
= "Sheet3"
Attribute VB_GlobalNameSpace 
= False
Attribute VB_Creatable 
= False
Attribute VB_PredeclaredId 
= True
Attribute VB_Exposed 
= True
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Rem
 妯″潡鍚嶇О: 鐢熸垚鎻掑叆SQL                                                 Rem
Rem
     浣滆? Huyvanpull                                                  Rem
Rem
     鐗堟湰: V0.1                                                        Rem
Rem
 緙栧啓鏃墮棿: 2011.09.16                                                  Rem
Rem
 淇敼鏃墮棿: 2011.09.16                                                  Rem
Rem
 鍔熻兘鎻忚堪: 鏍規嵁鏁版嵁Sheet鐨勫唴瀹瑰湪鍙︿竴涓猄heet鍐呯敓鎴愭彃鍏QL               Rem
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit

Const strTableNameCell = "A1"        '琛ㄥ悕鎵鍦ㄧ殑浣嶇疆
Const intHeaderRow = 3               '鏁版嵁琛ㄥご鎵鍦ㄨ
Const strDataSheetName = "鏁版嵁婧?/span>"    '淇濆瓨鏁版嵁鐨凷heet鍚嶇О
Const strIsqlSheetName = "鎻掑叆SQL"   '淇濆瓨SQL鐨凷heet鍚嶇О
Const strDeleSheetName = "鍒犻櫎SQL"   '瀛樺垹闄QL鐨凷heet鍚嶇О

Dim strTableName As String           '鏁版嵁搴撹〃鍚?/span>
Dim strTemSql As String              '涓存椂SQL璇彞
Dim strInsertSql As String           '鎻掑叆SQL璇彞

Dim intClumnCount As Integer         '鍒楁暟
Dim intIndex1 As Integer             '绱㈠紩鍙橀噺
Dim intIndex2 As Integer             '絎簩涓儲寮曞彉閲?/span>
Dim intIndex3 As Integer             '絎笁涓彉閲?/span>


Rem 嬋媧繪湰Sheet鏃舵墽琛?鐢熸垚鎻掑叆SQL
Private Sub Worksheet_Activate()
    
Rem 娓呯┖SQL鐨凷heet
    Worksheets(strIsqlSheetName).Select
    Cells.Select
    Selection.ClearContents
    ActiveCell.Select
    
    
Rem 寰楀埌琛ㄥ悕
    strTableName = Worksheets(strDataSheetName).Range(strTableNameCell).Value
    
Rem 鍒楁暟
    intClumnCount = Worksheets(strDataSheetName).Range("IV" & intHeaderRow).End(xlToLeft).Column
    
    
Rem 寮濮嬬粍瑁匰QL璇彞
    strTemSql = "INSERT INTO "
    strTemSql 
= strTemSql + strTableName
    strTemSql 
= strTemSql + " ("
    
    
Rem 緇勮瀛楁澶?/span>
    For intIndex1 = 1 To intClumnCount
        strTemSql 
= strTemSql + Worksheets(strDataSheetName).Cells(intHeaderRow, intIndex1).Value
        
If intIndex1 < intClumnCount Then
            strTemSql 
= strTemSql + ","
        
End If
    
Next intIndex1
    
    
Rem 涓嬫潯璇彞緇勮TempSQL瀹屾垚
    strTemSql = strTemSql + ") VALUES ("
    
    
Rem 緇勮SQL璇彞浣?/span>
    For intIndex2 = intHeaderRow + 1 To Worksheets(strDataSheetName).UsedRange.Rows.Count
        strInsertSql 
= strTemSql
        
For intIndex3 = 1 To intClumnCount
            
Rem 鍔犱笂鍗曞厓鏍奸噷鐨勬暟鎹?/span>
            strInsertSql = strInsertSql + getCellVal(Worksheets(strDataSheetName).Cells(intIndex2, intIndex3))
            
If intIndex3 < intClumnCount Then
                strInsertSql 
= strInsertSql + ","
            
End If
        
Next intIndex3
        strInsertSql 
= strInsertSql + ");"
        
        
Rem MsgBox strInsertSql
        
        
Rem 鍚戞彃鍏QL鐨凷heet璧嬪?/span>
        Worksheets(strIsqlSheetName).Cells(intIndex2 - intHeaderRow, 1).Value = strInsertSql
    
Next intIndex2
    
    
    
Rem 璁劇疆鎻掑叆SQL鐨凷heet鐨勬牱寮?/span>
    Worksheets(strIsqlSheetName).UsedRange.Select
    
With Selection
        .Font.Size 
= 9                       '璁劇疆瀛楀彿Font.Name = "MS Sans Serif"         '璁劇疆瀛椾綋
        .Font.Color = 1                      '璁劇疆瀛楃殑棰滆壊Borders.LineStyle = xlContinuous    '璁劇疆瀹炵嚎杈規
        .Columns.AutoFit                     '璁劇疆鍗曞厓鏍煎搴﹁嚜閫傚簲錛堟牴鎹崟鍏冩牸鍐呮枃瀛楅兘鏄嚜鍔ㄨ皟鑺傝鍗曞厓鏍肩殑瀹藉害錛?/span>
    End With
    
Rem 閫変腑絎竴涓崟鍏冩牸
    Worksheets(strIsqlSheetName).Range("A1").Select
    
    
    
Rem 鍒犻櫎SQL鐨凷heet鐨勫?/span>
    Worksheets(strDeleSheetName).Range("A1").Value = "--DELETE FROM " + strTableName + " WHERE 1=1"
    Worksheets(strDeleSheetName).Range(
"A4").Value = "          Write By: Huyvanpull"
    Worksheets(strDeleSheetName).Range(
"A5").Value = "                QQ: 182429125"
    Worksheets(strDeleSheetName).Range(
"A6").Value = "              Date: 2011-09-17"
End Sub


Rem 鏍規嵁綾誨瀷寰楀埌Cell閲岀殑鍊肩殑鍑芥暟
Function getCellVal(c)
  
Dim tempStr As String
  
  
Rem 濡傛灉鍗曞厓鏍兼槸鏁板瓧
  If IsNumeric(c.Value) Then
      tempStr 
= "'"
      
Rem 濡傛灉涓嶆槸鏁存暟,鍦ㄥ墠闈㈠姞0
      If Int(c.Value) <> c.Value Then
          tempStr 
= tempStr + "0"
      
End If
      tempStr 
= tempStr + CStr(c.Value)
      tempStr 
= tempStr + "'"
      
  
Rem 濡傛灉鍗曞厓鏍兼槸鏄棩鏈熷瀷
  ElseIf IsDate(c.Value) Then
      tempStr 
= "to_date('"
      tempStr 
= tempStr + Format(c.Value, "yyyy-mm-dd hh:mm:ss")
      tempStr 
= tempStr + " ','yyyy-mm-dd hh:mi:ss')"
      
  
Rem 濡傛灉鍗曞厓鏍兼槸鍏跺畠鏁版嵁綾誨瀷
  Else
     tempStr 
= "'"
     tempStr 
= tempStr + CStr(c.Value)
     tempStr 
= tempStr + "'"
  
End If
  
  
Rem 榪斿洖瀛楃涓?/span>
  getCellVal = tempStr
End Function



]]>
主站蜘蛛池模板: 万盛区| 龙里县| 东安县| 乌什县| 镇康县| 宁波市| 封开县| 密山市| 茶陵县| 丰都县| 和田市| 武城县| 南阳市| 伊川县| 昆明市| 嘉黎县| 类乌齐县| 宜良县| 米易县| 吉首市| 温州市| 景宁| 台江县| 耒阳市| 辉南县| 晋州市| 十堰市| 崇文区| 贺州市| 梅河口市| 普定县| 汤阴县| 永济市| 江陵县| 浪卡子县| 建宁县| 邛崃市| 双江| 黄骅市| 茶陵县| 新田县|