Imports System.Data.SqlClient
Module SQL_Module
    Public ConString As String : Public AccessConString As String : Public SQL1 As String : Public SQL2 As String : Public conn As New SqlConnection : Public cmd As New SqlCommand
    Public dr As SqlDataReader : Public da As New SqlDataAdapter
    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_FTP資料夾路徑分配()
        ConnOpen() : SQL1 = "SELECT 資料夾名稱, 指定頁面, 備註, 指定 FROM FTP資料夾管理 ORDER BY 指定" : CmdSet_For_DGV()
    End Sub
    Friend Sub SQL_FTP伺服器登入位置()
        ConnOpen() : SQL1 = "SELECT  FTP地址, FTP帳號, FTP密碼, FTP物理位置 FROM FTP資料庫管理 WHERE 地區 LIKE N'" & HX_PGS_UPDATE.伺服器區域_cb.Text & "'" : CmdSet_For_dr()
    End Sub
End Module
