有一个带有文本框的powerpoint,带有信息的组合框。我想将数据从电源点导出到aceess数据库。我想像表单一样使用powerpoint来完成数据库。
解决方案是使用按钮来更新此数据库。 任何人都有此按钮的代码?
答案 0 :(得分:0)
以下是一种方法的粗略说明。还有许多其他可能性。
''Library reference: Microsoft ActiveX data Objects x.x Lubrary
Dim cmd As ADODB.Command
Dim cn As ADODB.Connection
Dim scn As String, ssql As String
''See also http://ConnectionStrings.com
scn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Z:\Docs\Test.accdb;"
Set cmd = CreateObject("ADODB.Command")
Set cn = CreateObject("ADODB.Connection")
cn.Open scn
ssql = "insert into table1 (atext,amemo) values( p1,p2)"
With cmd
.CommandText = ssql
.ActiveConnection = cn
.CommandType = adCmdText
.Parameters.Append .CreateParameter( _
"p1", adVarChar, adParamInput, 50, Me.ComboBox1)
.Parameters.Append .CreateParameter( _
"p2", adVarChar, adParamInput, 50, Me.TextBox1)
.Execute recs
End With
MsgBox recs