55
ห้อง Ms Access อื่นๆ / : MS Access ส่ง Line notify ข้อความ รูปภาพ
« เมื่อ: 06 เม.ย. 62 , 10:41:35 »
ผมนำไปใช้กับการแจ้งเตือนอุณหภูมิห้อง server และปัญหาเครืองจักรใน line ผลิตครับ
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Public Function MakeTableWithConvertToRow2(ByVal sMainTable As String, ByVal sTempTable As String)
'On Error Resume Next
Dim RS_IN As DAO.Recordset
Dim RS_OUT As DAO.Recordset
Dim ColName As Integer
Set RS_IN = CurrentDb.OpenRecordset("Select" & "* from " & sMainTable & "")
'Set RS_OUT = CurrentDb.OpenRecordset("Select" & "* from " & sTempTable & "")
Set RS_OUT = CurrentDb.OpenRecordset(sTempTable, dbOpenTable)
Do While Not RS_IN.EOF
RS_OUT.Index = "PrimaryKey"
RS_OUT.Seek "=", RS_IN(0).Value
For ColName = 0 To RS_OUT.Fields.Count - 1
If RS_OUT.NoMatch Then
RS_OUT.AddNew
Else
RS_OUT.Edit
End If
If RS_IN(1).Value = RS_OUT(ColName).Name Then
RS_OUT(0).Value = RS_IN(0).Value
RS_OUT(RS_OUT(ColName).Name).Value = RS_IN(2).Value
RS_OUT.Update
End If
Next
RS_IN.MoveNext
Loop
RS_IN.Close
RS_OUT.Close
Set RS_IN = Nothing
Set RS_OUT = Nothing
End Function
ผมลองโหลดตัวอย่างที่ให้มาลองดูนับ Column ได้ 17 (op1) เหลือสองอันท้ายไม่มีข้อมูลไม่มีข้อมูลแต่มี | ขั้นไว้ครับ ครบ 19 column
เมื่อส่งออกไปแล้ว ลองมาดูตารางที่ส่งออก มันก็ออกครบ 19
แต่ลองนำเข้ากลับมา มันเป็นแบบ รูปที่แสดงครับ