adodb

Inserting NULL values in a database from VBA code

点点圈 提交于 2019-11-26 21:42:26
问题 I have 3 radioButtons ("YES", "NO", "UNKNOWN") wich matches a column from my database with 3 possible values (1, 0, NULL). When the radioButton selected is "UNKNOWN" I want to insert a NULL value in this table (using Variant type). But when I try to run my SQL query with my ADODB connection, it returns an error. Is there a trick to pass NULL values in my database ? Here's a copy of my code : Public Function setCandidature(idC As Integer, idO As Integer, nomC As String, prenomC As String, nomM

Running multiple async queries with ADODB - callbacks not always firing

自作多情 提交于 2019-11-26 20:27:10
问题 I have an Excel workbook that fires three queries to a database to populate three tables on hidden sheets, and then runs three 'refresh' scripts to pull this data through to three visible presentation sheets (one per query). Running this synchronously is quite slow: The total time to refresh is the sum of the time of each of the three queries, plus the sum of the time for each 'refresh' script to run. I'm aware that VBA isn't multi-threaded, but I thought it would be possible to speed things

How do I run a VBScript in 32-bit mode on a 64-bit machine?

拥有回忆 提交于 2019-11-26 19:42:33
I have a text file that ends with .vbs that I have written the following in: Set Conn = CreateObject("ADODB.Connection") Conn.Provider = "Microsoft.ACE.OLEDB.12.0" Conn.Properties("Data Source") = "C:\dummy.accdb" Conn.Properties("Jet OLEDB:Database Password") = "pass" Conn.Open Conn.Close Set Conn = Nothing When I execute this on a Windows 32-bit machine it runs and ends without any notion (expected). When I execute this on a Windows 64-bit machine it gets the error Provider cannot be found. It may not be properly installed. But it is installed. I think the root of the problem is that the

Merge multiple rows in a single row depending on conditions using VBScript

南笙酒味 提交于 2019-11-26 18:39:32
问题 Suppose, I have An Excel Matrix like below : EmpId Empname EmpAddrs Hiredate joiningdate Salary TypeOfWorker BondOver CurrentBU reporting officer Manager 11 abc eee 12/10 01/11 20K "P" Yes ALP MM PMO 12 abc tpt 10/10 01/11 10K "T" No ATP MM PMO 82 abc tpp 08/10 01/11 10K "T" No ATP MM OOP 72 abc tpp 08/10 01/11 10K "P" No ATT MM OOP I Need to merge them all as below: Manager EmpId Hiredate TypeOfWorker CurrentBU reporting officer EmpId Hiredate TypeOfWorker CurrentBU reporting officer PMO 11

Accessing SQL Database in Excel-VBA

喜欢而已 提交于 2019-11-26 16:08:41
I am copying an VBA code snippet from MSDN that shows me how to grab results from a SQL query into excel sheet (Excel 2007): Sub GetDataFromADO() 'Declare variables' Set objMyConn = New ADODB.Connection Set objMyCmd = New ADODB.Command Set objMyRecordset = New ADODB.Recordset 'Open Connection' objMyConn.ConnectionString = "Provider=SQLOLEDB;Data Source=localhost;User ID=abc;Password=abc;" objMyConn.Open 'Set and Excecute SQL Command' Set objMyCmd.ActiveConnection = objMyConn objMyCmd.CommandText = "select * from myTable" objMyCmd.CommandType = adCmdText objMyCmd.Execute 'Open Recordset' Set

Passing Parameters to a Stored Procedure using ASP

[亡魂溺海] 提交于 2019-11-26 11:40:01
问题 I\'m trying to pass some parameters to a SQL stored procedure in my classic ASP. I\'ve seen several posts on this and not sure what I\'m doing wrong as I don\'t seem to see my discrepancy. set conn = CreateObject(\"ADODB.Connection\") conn.open (\"DSN=SERVER;UID=username;PWD=pwd;Database=MyDatabase\") set cmd = Server.CreateObject(\"ADODB.Command\") set cmd.ActiveConnection = conn cmd.CommandType = adCmdStoredProc cmd.CommandText = my_proc cmd.Parameters.Refresh cmd.Parameters(1) = \"MyParam\

VBScript & Access MDB - 800A0E7A - “Provider cannot be found. It may not be properly installed”

纵饮孤独 提交于 2019-11-26 09:12:36
问题 I\'ve having a problem with a VBScript connecting to an access MDB Database. My platform is Vista64, but the majority of resources out there are for ASP/IIS7. Quite simply, I can\'t get it to connect. I\'m getting the following error: 800A0E7A - \"Provider cannot be found. It may not be properly installed\" My code is: Set conn = CreateObject(\"ADODB.Connection\") strConnect = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\database.MDB\" conn.Open strConnect So far I have ran %WINDIR%\

ADODB.Parameters error '800a0e7c' Parameter object is improperly defined. Inconsistent or incomplete information was provided

ε祈祈猫儿з 提交于 2019-11-26 08:36:04
问题 I\'m primarily an PHP developer, but I have some old ASP one of our previous developers made that broke and I can\'t figure out how to fix it. We have a program that sends some variables to a listener page that compares that data to registration codes an msSQL database and then lets the program know if the registration code is valid. I\'m getting the following error where .Parameters.Append .CreateParameter(\"@code\", adVarChar, 1, 50, x) is line 134: ADODB.Parameters error \'800a0e7c\'

Accessing SQL Database in Excel-VBA

感情迁移 提交于 2019-11-26 04:44:52
问题 I am copying an VBA code snippet from MSDN that shows me how to grab results from a SQL query into excel sheet (Excel 2007): Sub GetDataFromADO() \'Declare variables\' Set objMyConn = New ADODB.Connection Set objMyCmd = New ADODB.Command Set objMyRecordset = New ADODB.Recordset \'Open Connection\' objMyConn.ConnectionString = \"Provider=SQLOLEDB;Data Source=localhost;User ID=abc;Password=abc;\" objMyConn.Open \'Set and Excecute SQL Command\' Set objMyCmd.ActiveConnection = objMyConn objMyCmd

SQL injections in ADOdb and general website security

烂漫一生 提交于 2019-11-26 01:08:57
问题 I have done pretty much reading and still don\'t understand 100% how some of the SQL injections happen! I\'d like to see, from those who know, concrete examples of SQL injection based on my example, so it could be replicated, tested and fixed. I have tried to SQL inject my code and couldn\'t, so I\'d like someone to prove me otherwise! 1.Am I right that SQL injection can happen ONLY with POST or GET methods, meaning that on the website it should be the post form, e.g. \'signup or search\' or