1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- Imports System.Data.OleDb
- Imports System.Data.SqlClient
-
- Module SQL_連線字串
- Friend Sub SQL_連線字串_測試()
- ConString_T = "Data Source=" & 登入人IP2 & ";Initial Catalog=HX-GPS-ERP-SYS;Persist Security Info=True;User ID=b70340;Password=Lee0911274990;Max pool size = 200;Connection Timeout=0"
- End Sub
- Friend Sub SQL_連線字串_測試_工程SQL()
- ConString1_T = "Data Source=" & 登入人IP2 & ";Initial Catalog=PROJECT-SYS;Persist Security Info=True;User ID=b70340;Password=Lee0911274990;Max pool size = 200; Connection Timeout=0"
- End Sub
- Friend Sub SQL_連線字串_測試_管理SQL()
- ConString3_T = "Data Source=" & 登入人IP2 & ";Initial Catalog=HX-PGS-MSN;Persist Security Info=True;User ID=b70340;Password=Lee0911274990;Max pool size = 200; Connection Timeout=0"
- End Sub
-
- Friend Sub SQL_連線字串_正式()
- ConString = "Data Source=" & 登入人IP1 & ";Initial Catalog=HX-GPS-ERP-SYS;Persist Security Info=True;User ID=b70340;Password=Lee0911274990;Max pool size = 200;Connection Timeout=0"
- End Sub
- Friend Sub SQL_連線字串_正式_工程SQL()
- ConString1 = "Data Source=" & 登入人IP1 & ";Initial Catalog=PROJECT-SYS;Persist Security Info=True;User ID=b70340;Password=Lee0911274990;Max pool size = 200; Connection Timeout=0"
- End Sub
- Friend Sub SQL_連線字串_正式_管理SQL()
- ConString3 = "Data Source=" & 登入人IP1 & ";Initial Catalog=HX-PGS-MSN;Persist Security Info=True;User ID=b70340;Password=Lee0911274990;Max pool size = 200; Connection Timeout=0"
- End Sub
-
- Friend Sub SQL_連線字串_測試_LINE_SQL()
- ConString4 = "Data Source=" & Line通訊IP & ";Initial Catalog=" & Line伺服器名稱 & ";Persist Security Info=True;User ID=b70340;Password=Lee0911274990;Max pool size = 200; Connection Timeout=0"
- End Sub
-
- '---------------資料庫連線字串宣告--------------------------------------------------------------------------------------------------------------------------------------------------------
- Public Access1 As New OleDbConnection : Public AccesCmd As OleDbCommand
- Public Acdr As OleDbDataReader
- Public ConString, ConString1, ConString2, ConString3, ConString4 As String : Public AccessConString As String : Public SQL1, SQL2, SQL3, SQL4, SQL5, SQL6, SQL7, SQL8, SQL9, SQL10 As String
- Public conn As New SqlConnection : Public cmd As New SqlCommand
- Public dr As SqlDataReader : Public da As New SqlDataAdapter
-
- Friend Sub ConnOpen_T()
- conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString_T : conn.Open() : End If
- End Sub
- Friend Sub ConnOpen_工程SQL_T()
- conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString1_T : conn.Open() : End If
- End Sub
- Friend Sub ConnOpen_管理SQL_T()
- conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString3_T : conn.Open() : End If
- End Sub
- Friend Sub ConnOpen_工程圖庫SQL_T()
- conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString2_T : conn.Open() : End If
- End Sub
-
- Friend Sub ConnOpen()
- conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- End Sub
- Friend Sub ConnOpen_工程SQL()
- conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString1 : conn.Open() : End If
- End Sub
- Friend Sub ConnOpen_管理SQL()
- conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString3 : conn.Open() : End If
- End Sub
- Friend Sub ConnOpen_工程圖庫SQL()
- conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString2 : conn.Open() : End If
- End Sub
- Friend Sub ConnOpen_LINE_SQL()
- SQL_連線字串_測試_LINE_SQL()
- conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString4 : 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
- End Module
|