Imports System.Data.SqlClient Imports System.IO Module SQL_Module Public ConString, SQL1, SQL2, 進度條後墜, PA As String Public conn As New SqlConnection : Public cmd As New SqlCommand Public dr As SqlDataReader : Public da As New SqlDataAdapter Public 分段1, 分段2, 分段3, 分段4 As Double Public 分母, 圖庫限制 As Integer Friend Sub ConnOpen() conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If End Sub Friend Sub CmdSet_For_DGV() cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd End Sub Friend Sub CmdSet_For_dr() cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader End Sub Friend Sub SQL_連線字串_資料庫() ConString = "Data Source=" & GCM_SQL_MGMT.IP_tb.Text & "; Initial Catalog=" & GCM_SQL_MGMT.資料庫_tb.Text & "; Persist Security Info=True; User ID=" & GCM_SQL_MGMT.帳號_tb.Text & "; Password=" & GCM_SQL_MGMT.密碼_tb.Text & "; Max pool size = 200; Connection Timeout=0" End Sub Friend Sub SQL_連線字串_圖片資料庫() ConString = "Data Source=" & GCM_SQL_MGMT.IP_tb.Text & "; Initial Catalog=" & GCM_SQL_MGMT.選擇_tb.Text & "; Persist Security Info=True; User ID=" & GCM_SQL_MGMT.帳號_tb.Text & "; Password=" & GCM_SQL_MGMT.密碼_tb.Text & "; Max pool size = 200; Connection Timeout=0" End Sub End Module