Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.
Public Sub OPEN_CON1(cn As ADODB.Connection, db As String, ServerName As String) Set cn = New ADODB.Connection cn.Provider = "sqloledb" cn.ConnectionTimeout = 25 cn.Properties("Data source").Value = Trim(ServerName) cn.Properties("Initial Catalog").Value = Trim(db) cn.Properties("User ID").Value = "sa" cn.Properties("Password").Value = "" cn.CursorLocation = adUseClient cn.Open , "sa", "" End Sub Public Sub save_Table(cn As ADODB.Connection, lpTable_No As String, Customer_name As String, Time_in As String, Time_Out As String) Dim rs As ADODB.Recordset Dim sql As String Set rs = New ADODB.Recordset sql = "select * from The_Table where Table_No='" & lpTable_No & "'" rs.LockType = adLockOptimistic rs.CursorType = adOpenKeyset rs.Open sql, cn With rs If .BOF = True And _ .EOF = True Then .AddNew !Table_No = lpTable_No End If !Customer_name = grid.TextMatrix(grid.Row, 1) !Time_in = Trim(grid.TextMatrix(grid.Row, 2)) !Time_Out = grid.TextMatrix(grid.Row, 3) .Update .Close End With Set rs = Nothing End Sub Private Sub CmdSave() Dim cn As ADODB.Connection Call OPEN_CON1(cn, "MyTable", "Winpos") Call save_Table(cn, grid.TextMatrix(grid.Row, 0), grid.TextMatrix(grid.Row, 1), grid.TextMatrix(grid.Row, 2), grid.TextMatrix(grid.Row, 3)) Set cn = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.