主题:[讨论]各位大虾!怎么样才能从textbox中将数据添加到access中?
各位大虾!怎么样才能从textbox中将数据添加到access中?
各位大虾!怎么样才能从textbox中将数据添加到access中?在网上搜索到:
{窗体上放置data,command,textbox控件各一个
建立数据库a,表名b,字段名c
代码如下:
Private Sub Command1_Click()
Data1.DatabaseName = App.Path & "\a.mdb"
Data1.RecordSource = "b"
Text1.DataField = "c"
End Sub
Private Sub Form_Load()
Command1.Caption = "连接"
End Sub
}
还有
{Private Sub Command1_Click()
Adodc1.Recordset.Update
End Sub
Private Sub Form_Load()
Adodc1.CommandType = adCmdText
Adodc1.LockType = adLockBatchOptimistic
'Access连接数据库
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"
Data Source = "你的文件的路径access.mdb"
Adodc1.RecordSource = "你Access文件里的表名"
Text1.DataSource = Adodc1
End Sub
}
试了一下都有问题啊,在线等待解决!
各位大虾!怎么样才能从textbox中将数据添加到access中?在网上搜索到:
{窗体上放置data,command,textbox控件各一个
建立数据库a,表名b,字段名c
代码如下:
Private Sub Command1_Click()
Data1.DatabaseName = App.Path & "\a.mdb"
Data1.RecordSource = "b"
Text1.DataField = "c"
End Sub
Private Sub Form_Load()
Command1.Caption = "连接"
End Sub
}
还有
{Private Sub Command1_Click()
Adodc1.Recordset.Update
End Sub
Private Sub Form_Load()
Adodc1.CommandType = adCmdText
Adodc1.LockType = adLockBatchOptimistic
'Access连接数据库
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"
Data Source = "你的文件的路径access.mdb"
Adodc1.RecordSource = "你Access文件里的表名"
Text1.DataSource = Adodc1
End Sub
}
试了一下都有问题啊,在线等待解决!