adodb

Excel VBA MySql parameterised update 'invalid parameter type'

两盒软妹~` 提交于 2021-01-04 12:25:43
问题 I am creating an interface where users can use excel to seamlessly alter an SQL database. I can retrieve data fine however when updating records I get an 'invalid parameter type'. It works fine with just concatenating values into the query, however to prevent SQL injections I require a parameterised query. I have tried substituting in the ADO datatype with the value however this has not changed anything. I have tried unnamed parameters which just always submits a value of 16 to the database

Excel VBA MySql parameterised update 'invalid parameter type'

孤者浪人 提交于 2021-01-04 12:24:54
问题 I am creating an interface where users can use excel to seamlessly alter an SQL database. I can retrieve data fine however when updating records I get an 'invalid parameter type'. It works fine with just concatenating values into the query, however to prevent SQL injections I require a parameterised query. I have tried substituting in the ADO datatype with the value however this has not changed anything. I have tried unnamed parameters which just always submits a value of 16 to the database

delphi(假三层之数据访问层)(第一天)

佐手、 提交于 2021-01-04 08:34:11
本论文主要是通过三天来讲解三层的结构,今天是第一天,先讲解一下delphi下的Models层,我主要封装了两个查询得到数据集的函数,主要是通过在表示层上创建的数数据集控件传递进来,通过业务逻辑对语句的处理进行操作数据集,最后提交数据集的数据到数据库中去,进而想成delphi中的假三层,这样做能够独立于业务逻辑层和数据访问层,其他的都可以调用这两层,其中业务逻辑层,明天再讲,逻辑层写的不怎么好,个人觉得还是数据访问层封装方法封装通用性程度高一点。例如:TADOQuery,TADOTable数据集控件,通过一层一层的传递。 下面直接上代码: unit UnitModels; interface uses SysUtils, Classes, DB, ADODB; type TModel = class(TDataModule) conConnection: TADOConnection; procedure DataModuleCreate(Sender: TObject); private { Private declarations } public { Public declarations } FConnection : TADOConnection; // 返回影响的行数 function SqlExec(const ASql: string;var AQry:

MySQL Recordset Not Returning Values When it Should

那年仲夏 提交于 2021-01-01 04:14:43
问题 I'm trying to retrieve a recordset from MySQL through VBA (in Excel) using ADODB. I can successfully connect to the MySQL database over the network and can even return a list of the tables using ADOX, however when I try to return a recordset the recordcount is -1 and it is empty. When I enter the same SQL statement into MySQL Workbench the result is returned as expected. I have been successfully connecting to an Access database with ADO and now want to move that database to MySQL and have run

MySQL Recordset Not Returning Values When it Should

三世轮回 提交于 2021-01-01 04:08:35
问题 I'm trying to retrieve a recordset from MySQL through VBA (in Excel) using ADODB. I can successfully connect to the MySQL database over the network and can even return a list of the tables using ADOX, however when I try to return a recordset the recordcount is -1 and it is empty. When I enter the same SQL statement into MySQL Workbench the result is returned as expected. I have been successfully connecting to an Access database with ADO and now want to move that database to MySQL and have run

MySQL Recordset Not Returning Values When it Should

杀马特。学长 韩版系。学妹 提交于 2021-01-01 04:03:57
问题 I'm trying to retrieve a recordset from MySQL through VBA (in Excel) using ADODB. I can successfully connect to the MySQL database over the network and can even return a list of the tables using ADOX, however when I try to return a recordset the recordcount is -1 and it is empty. When I enter the same SQL statement into MySQL Workbench the result is returned as expected. I have been successfully connecting to an Access database with ADO and now want to move that database to MySQL and have run

三、K3 WISE 开发插件《K3 WISE开发手册》

我与影子孤独终老i 提交于 2020-12-24 08:59:09
1.VB插件工程的命名、命名空间和生成的DLL命名要一致,否则导致注册不成功! 2.主控台的查询分析工具,添加sql直接报表,代码用到临时表,提示“在对应所需名称或序数的集合中未找到项目” 解决:在代码开头加上: set nocount on 3.如何用MRP计算一个无销售订单的BOM表产生的采购需求? 问题补充:通过BOM表,利用BOM表的采购件来推出采购需求,生成采购申请单,推出采购订单进行采购,然后做外购入库 解决:做一张该BOM表的产品预测单--MRP运算--采购需求--采购申请--采购订单---外购入库, 做完流程后,关闭采购申请--关闭采购需求--关闭产品预测单。用产品预测单来提取采购件的采购需求。 4.存货核算--凭证生成,生成外购入库凭证时,提示取凭证模板失败 “当前默认凭证模板设置不正确,凭证字不存在!” 解决:模板设置里,分【实际成本法部分】和【计划成本法部分】,里面都有外购入库部分,都要设置模板 5.启用批号管理后,使用一段时间,又要取消批号,应该怎么做? 把 库存清空 取消批次 (用其他出库 全部出了) 然后 后台修改 取消批次 ======================== select fbatchmanager,fnumber from t_icitem where fnumber = 'OP.19.0002-000'--批次管理 update t

asp Excel导入数据库

末鹿安然 提交于 2020-11-28 04:10:30
<% dim FileName FileName="Excel.xls" '取得文件名,来自项目经理的指定,路径固定在某个虚拟路径中 Dim conn, rs set conn=CreateObject("ADODB.connection") conn.Open "Driver={Microsoft Excel Driver (*.xls)};" & _ "DriverId=790;" & _ "Dbq=" & Server.mappath(""&FileName&"") & ";" & _ "DefaultDir=G:/" set rs=createobject("ADODB.recordset") rs.Open "Select * From [Sheet1$]",conn, 2, 2 if rs.eof then response.write "Excel表中无纪录" else set connDB = Server.CreateObject("ADODB.Connection") DBPath = Server.MapPath("Excel.mdb") 'RESPONSE.WRITE DBpath connDB.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath Set RsDB = Server

VB6.0 Datatable与Recordset转换

二次信任 提交于 2020-11-27 09:08:27
这里介绍新的datagrid.datasoure所对应的是VB6.0 datatable或dataset,而并不是原来的Recordset。所以,在使用中,要把Recordset转换成VB6.0 datatable或dataset。 VB6.0还是比较常用的,于是我研究了一下VB6.0 datatable,在这里拿出来和大家分享一下,希望对大家有用。 在VB6.0在,ADO是大家在数据库编程中用得较多的。而在新的vb.net中,虽然也可以用它来查询数据库,但在与新的datagrid的绑定中,不能像以前那样使用:“datagrid1.datasoure=rs”,而是需要一定的转化。因为新的datagrid.datasoure所对应的是VB6.0 datatable或dataset,而并不是原来的Recordset。所以,在使用中,要把Recordset转换成VB6.0 datatable或 dataset。我们以VB6.0 datatable为例: Function RecordsetToDataTable( ByVal adoRS As ADODB.Recordset, ByVal strTable As String ) adoRS.MoveFirst() Dim dt As DataTable dt = New DataTable(strTable) Dim i As

数据库学习建议之提高数据库速度的十条建议

放肆的年华 提交于 2020-11-19 07:03:34
很多网站的重要信息都是保存在数据库中的,用户通过提交访问数据库来获取用户信息。如果数据库速度非常的快,有助于节省服务器的资源,在这篇文章中,我收集了十个优化数据库速度的技巧。 0. 小心设计数据库 第一个技巧也许看来理所当然,但事实上大部分数据库的问题都来自于设计不好的数据库结构。 譬如我曾经遇见过将客户端信息和支付信息储存在同一个数据库列中的例子。对于系统和用数据库的开发者来说,这很糟糕。 新建数据库时,应当将信息储存在不同的表里,采用标准的命名方式,并采用主键。 来源: http://www.simple-talk.com/sql/database-administration/ten-common-database-design-mistakes/ 1. 清楚你需要优化的地方 如果你想优化某个查询语句,清楚的知道这个语句的结果是非常有帮助的。采用EXPLAIN语句,你将获得很多有用的信息,下面来看个例子: 1 EXPLAIN SELECT * FROM ref_table,other_table WHERE ref_table.key_column=other_table. column ; 来源: http://dev.mysql.com/doc/refman/5.0/en/using-explain.html 2. 最快的查询语句…是那些你没发送的语句