Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement sql query Analyzer lcx by vbs

Shulou Source: shulou.com Published: 2022-06-03 06:02:36 10月04日 Update

This article will explain in detail how vbs implements the sql query analyzer lcx. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Example:

If (lcase (right (wscript.fullname,11)) = "wscript.exe") then

Echo "Execute it under the cmd.exe Plz! Thx."

Echo "code by lcx"

Wscript.quit

End If

If wscript.arguments.count0 Then

Echo "SQL Operation-execution result" & vbcrlf

For j = 0 To rs.Fields.Count-1

Echo rs.Fields (j). Name & vbcrlf

Next

For I = 1 To 20

If rs.Eof Then

Exit For

End If

For j = 0 To rs.Fields.Count-1

Echo fixNull (rs (j)) & vbcrlf

Next

Rs.MoveNext

Next

End If

Echo "="

Echo "Common" & rs.Fields.Count& "column" & vbcrlf

For I = 1 To rs.PageCount

Page=i

Next

Echo "Co-ownership" & page & "Page"

Rs.Close

Else

If sql "" Then

Conn.Execute (sql)

ChkErr (Err)

Echo "execution complete" & vbcrlf

End If

End If

Conn.Close

Set rs = Nothing

Set conn = Nothing

Set rsTable = Nothing

End Sub

Function getDataType (typeId)

Select Case typeId

Case 130

GetDataType = "text"

Case 2

GetDataType = "integer"

Case 3

GetDataType = "long integer"

Case 7

GetDataType = "date / time"

Case 5

GetDataType = "double precision"

Case 11

GetDataType = "Yes / No"

Case 128

GetDataType = "OLE object"

Case Else

GetDataType = typeId

End Select

End Function

Function getTableList (conn, sqlStr, rsTable)

Set rsTable = conn.OpenSchema (20, Array (Empty, "table"))

Echo "the following table name exists:"

Do Until rsTable.Eof

GetTableList = getTableList & "[" & rsTable ("Table_Name") & "]" & vbcrlf

RsTable.MoveNext

Loop

RsTable.MoveFirst

End Function

This is the end of this article on "how vbs implements sql query Analyzer lcx". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Tags: Articles parsers analysis queries more precision errors good practical information content commands sizes fields characters strings objects data databases text Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Redmi Microsoft Shulou Information macOS