adodb

SQL Query with like returns differently in php

泪湿孤枕 提交于 2019-12-12 03:49:38
问题 Solved: I tested writing the query as a stored procedure and again it still reported incorrectly in php. Ultimately I found out that because I have some columns with nulls PHP was reading them strangely. Disappointing to learn that Perl handled this better, but oh well. I'm using PHP 5.3.3 with adodb to access MS SQL server 2012. Most of my queries have been fine, but I'm trying to do a full join with wildcards. Here's the on portion: on a_table.hostname LIKE '%' + r_table.Hostname + '%' OR '

Python to open ADODB recordset and add new record

假如想象 提交于 2019-12-12 03:45:18
问题 in my wxPython app which I am developing I have written a method which will add a new record into an access database (.accdb). I have procured this code from online search however am not able to make it work. Below is the code:- def Allocate_sub(self, event): pth = os.getcwd() myDb = pth + '\\myAccessDB.accdb' DRV = '{Microsoft Access Driver (*.mdb)}' PWD = 'pw' # connect to db con = win32com.client.Dispatch(r'ADODB.Connection') con.Open('DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=

ADODB Recordset.RecordCount giving incorrect answer

谁都会走 提交于 2019-12-12 03:33:42
问题 I have an issue with my Recordset returning -1 as the RecordCount when in fact there are 1164 records. I have checked my query which is fine. Even though it tells me there are -1 records the CopyFromRecordset method still works and pastes the correct results. Never had an issue before using the rs.RecordCount ? Dim strSQL As String Dim rs As New ADODB.Recordset If cust = "JPM" Then port = "RP L99" Else port = "RP V10" End If strSQL = "my select query" rs.Open strSQL, cn, adOpenKeyset,

Set a limit / maxRecords property for Windows Indexing Search through PHP COM

无人久伴 提交于 2019-12-12 02:35:39
问题 I'm using Windows Indexing search together with PHP to search inside thousands of files. I got it working by using the PHP COM class: $conn = new COM("ADODB.Connection") or die("Cannot start ADO"); $recordset = new COM("ADODB.Recordset"); $conn - > Open("Provider=Search.CollatorDSO;Extended Properties='Application=Windows';"); $recordset - > Open("SELECT System.ItemName, System.DateModified FROM SYSTEMINDEX WHERE DIRECTORY='file:C:/xxxx/' AND CONTAINS('xxxx')", $conn); $recordset - >

Excel VBA ADODB DataType selection

谁都会走 提交于 2019-12-12 01:27:02
问题 I have a data set in MS Excel 2013 which looks like this: +------+------------+----------------+ | Name | DateWorked | HoursCompleted | +------+------------+----------------+ | abc | 03/01/2016 | 4:53 | | abc | 03/02/2016 | 5:22 | | ghi | 03/03/2016 | 2:10 | | jkl | 03/04/2016 | 5:30 | | mno | 03/05/2016 | 4:20 | | pqr | 03/06/2016 | 0:20 | +------+------------+----------------+ where Name is string, DateWorked is mm/dd/yyyy, HoursCompleted is h:mm data type/format. I am using ADODB to get

How to use last_insert_id() with “ADODB.Connection” object correctly?

牧云@^-^@ 提交于 2019-12-12 01:14:31
问题 I'm having a problem in retrieving last record id from database. This code below, is the closer I can get. But still, it return record id, as 0; ,then when I execute again, it will return, record of previous execute, not the current one. sql = "insert into program (prog_det,budget,prog_obj,outcome,target_group,awareness,engagement,issue,seq_no) value ('"&prog_title&"','"&prog_budget&"','"&prog_obj&"','"&prog_result&"','"&prog_target&"','"&prog_aware&"','"&prog_involment&"','"&prog_issues&"',

Permission denied in copying DB after connection closed

一笑奈何 提交于 2019-12-11 19:01:40
问题 I've been trying to copy paste a db and change a few entries. I believe I'm almost there but I hit a problem. It seems that I can copy my db no problem until I connect with it. During my connection (which makes sense) or after I close the connection I am no longer able to copy and paste the DB as I did before. I'm pretty sure there is a phantom reference to the connected (but now closed) db remaining somewhere in my code for on my first run through of the code I get the error on the second

Saving binary file from base64 text data by IE, ADODB.Stream to hard disk

橙三吉。 提交于 2019-12-11 16:23:46
问题 I had a problem when try to saving a binary file by IE, ADODB.Stream on client. Assume the the client's browser has full permission to write file to hard disk. Here is my client code witten by javascript.: var base64_encoded_string = "base64 string of a binary file"; var data = window.atob(base64_encoded_string); var stream = new ActiveXObject("ADODB.Stream"); stream.Type = 1; // text stream.Open(); stream.Write(data); //Problem in here stream.SaveToFile("D:\\Whatever.pfx", 2); stream.Close()

provider cannot be found error in python connecting to SQL Server

前提是你 提交于 2019-12-11 13:44:58
问题 I'm attempting to connect to a SQL Server database within a Python script. I'm using SQLNCLI as provider on my connection string. from win32com.client import Dispatch connection_string = "Provider=SQLNCLI;server=%s;initial catalog=%s;user id=%s;password=%s"%(server,db_name,user,pwd) dbConn = Dispatch("ADODB.Connection") dbConn.Open( connection_string ) When executing the script I get this error: provider cannot be found. It may not be properly installed. Any ideas on how to fix this? 回答1:

Connecting to an Access database in Classic ASP using an ADODB object

冷暖自知 提交于 2019-12-11 12:33:03
问题 I am new to classic ASP. I would rather ask question than do hour of research to solve my problem. I am accessing access database and getting the following error. Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /default1.asp, line 30 The culprit line is this Set MyConn = Server.CreateObject("ADODB.Connection") MdbFilePath = Server.MapPath("c:\database\MyDatabase.mdb") Well, I do not have