简体   繁体   English

将数据从电源点导出到访问数据库

[英]export data from power point to access database

In have a powerpoint with Text Box, Combo box with informations.I want to export data from power point to an aceess database.有一个带有文本框的 powerpoint,带有信息的组合框。我想将数据从 power point 导出到 aceess 数据库。 I want to use the powerpoint like an form to complete the database.我想像使用表格一样使用powerpoint来完成数据库。

Solution is to have an button to update this database.解决方案是有一个按钮来更新这个数据库。 Anyone has the code for this button?谁有这个按钮的代码?

Here are some rough notes on one approach.以下是关于一种方法的一些粗略说明。 There are a number of other possibilities.还有许多其他可能性。

''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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM