Write data to MS ACCESS Database
Free code, example code, sample code
Step 3: Select the following references
Step 4: Create MS ACCESS Database
Step 5: Add text-box and button
Step 5: Paste this VBScript
Private Sub Command1_Click()
Dim strfile As String
Dim Strcon As String
Dim sqlstr As String
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
strfile = "D:\Database.mdb"
Strcon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strfile & ";"
Set rs = New ADODB.Recordset
cn.Open Strcon
sqlstr = "SELECT * from Datalog_Table"
rs.Open sqlstr, cn, adOpenDynamic, adLockOptimistic
Text1.Text = rs!DateTime_Column
Text2.Text = rs!Data1_Column
rs.Close
cn.Close
End Sub
Enjoy! Now you can able to write present value and setpoint to database
No comments:
Post a Comment