日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

mysql 字段必填 属性_如何判断数据库中的字段是否具有必填属性(50分)

發布時間:2023/11/27 生活经验 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql 字段必填 属性_如何判断数据库中的字段是否具有必填属性(50分) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

你試試用SQLDMO吧

提供如下供參考

Option Explicit

Dim dd As SQLDMO.Database

Dim ss As New SQLDMO.SQLServer

Dim tt As SQLDMO.Table

Dim S As String

Sub AnalyzeDB()

Dim i As Long, j As Long

On Error Resume Next

'在下面修改機器名稱

'/

ss.Connect "hp-server", "sc", "320322"//sc 為登錄sql server的用戶名320322為口令

'/

For Each dd In ss.Databases

'在下面修改數據庫名稱

' //

If LCase(dd.Name) = "databasename" Then

'//

Selection.TypeText dd.Name & vbCrLf & vbCrLf

With ThisDocument.Tables.Add(Selection.Range, dd.Tables.Count + 1, 2)

.Cell(1, 1).Select

Selection.TypeText "表名"

.Cell(1, 2).Select

Selection.TypeText "說明"

For i = 1 To dd.Tables.Count

DoEvents

.Cell(i + 1, 1).Select

Selection.TypeText dd.Tables(i).Name

.Cell(i + 1, 2).Select

Selection.TypeText dd.Tables(i).Properties("Description").Value

Next i

End With

Selection.GoToNext wdGoToLine

Selection.TypeText vbCrLf

For i = 1 To dd.Tables.Count

DoEvents

'///

'If (LCase(dd.Tables(i).Name) = "sfdwsfxmk") Or (LCase(dd.Tables(i).Name) = "sfxmk") Or (LCase(dd.Tables(i).Name) = "sfdwxxk") Then

'//

Selection.TypeText dd.Tables(i).Name

Selection.TypeText dd.Tables(i).Properties("Description").Value

Selection.TypeText vbCrLf

With ThisDocument.Tables.Add(Selection.Range, dd.Tables(i).Columns.Count + 1, 7)

.Columns(1).Width = 104.4

.Columns(2).Width = 117

.Columns(3).Width = 72

.Columns(4).Width = 36

.Columns(5).Width = 27

.Columns(6).Width = 27

.Columns(7).Width = 42.55

.Cell(1, 1).Select: Selection.TypeText "字段"

.Cell(1, 2).Select: Selection.TypeText "說明"

.Cell(1, 3).Select: Selection.TypeText "類型"

.Cell(1, 4).Select: Selection.TypeText "長度"

.Cell(1, 5).Select: Selection.TypeText "NN"

.Cell(1, 6).Select: Selection.TypeText "ZL"

.Cell(1, 7).Select: Selection.TypeText "默認值"

For j = 1 To dd.Tables(i).Columns.Count

DoEvents

.Cell(j + 1, 1).Select: Selection.TypeText dd.Tables(i).Columns(j).Name

.Cell(j + 1, 2).Select: Selection.TypeText dd.Tables(i).Columns(j).Properties("Description").Value

.Cell(j + 1, 3).Select: Selection.TypeText dd.Tables(i).Columns(j).Datatype

.Cell(j + 1, 4).Select: Selection.TypeText dd.Tables(i).Columns(j).Length

.Cell(j + 1, 5).Select: Selection.TypeText IIf(dd.Tables(i).Columns(j).AllowNulls, "Y", "N")

.Cell(j + 1, 7).Select: Selection.TypeText dd.Tables(i).Columns(j).Default

Next j

End With

Selection.GoToNext wdGoToLine

Selection.TypeText vbCrLf

'///

'End If

'///

Next i

Set dd = Nothing

End If

Next

End

End Sub

這是用vba寫的你可以參考下改成delphi的就可以了

總結

以上是生活随笔為你收集整理的mysql 字段必填 属性_如何判断数据库中的字段是否具有必填属性(50分)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。