adodb

Change System.DateModified format on Windows Search

夙愿已清 提交于 2019-12-02 07:11:17
问题 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 - >

SQL pivot function text file database with VBA Excel

妖精的绣舞 提交于 2019-12-02 06:44:51
We do not have access to SQL server at work so I have to design an app within Excel VBA and using a text file (CSV) to store the data. I have no problem querying data, joining the CSV's, but I would like to use the SQL Pivot/Unpivot statement to transpose one of the columns into rows. I'm not sure if that functionality exists as I keep getting the error that there's a syntax error in my FROM clause. Public Function getData() As ADODB.Recordset Dim path As String, conn As ADODB.Connection, rs As ADODB.Recordset path = ThisWorkbook.path & "\" Set conn = New ADODB.Connection Set rs = New ADODB

Running 'SET' command in SQL, prior to SELECT

筅森魡賤 提交于 2019-12-02 06:43:26
Following this question , I need to add something like SET LANGUAGE German; before my SELECT query. I am running the query in an ASP/VBScript web environment, which basically limits me, as far as I know, to a single query at a time. If I run a query such as - SET LANGUAGE German; SELECT..... I get a no results message, because the 'data' returned is from the SET query and not the SELECT that follows it. Is there anything that can be done to run the SET and the SELECT together in the ASP/VBScript environment? UPDATE: As per Lankymarts suggestion: set rs = SERVER.CreateObject("ADODB.recordset")

Why should I close and destroy a recordset?

百般思念 提交于 2019-12-02 05:09:34
I read this article: http://www.utteraccess.com/wiki/Recordsets_for_Beginners , and it says that it's important for me to close and destroy RS's like this: rs.close Set rs = Nothing and if I don't, some bugs may happen. What kind of bugs? What does rs.close means? Does it mean that the connection to the database is kept open for as long as the rs isn't closed? rs.close cleans up the resources that are used internally, however because ASP is a single process that doesn't have any GC the Set rs = Nothing aids in the clean up. It de-references your objects, without it you'll have a memory leak.

Return a value and a result set from stored procedure classic asp

为君一笑 提交于 2019-12-02 01:21:07
问题 I want to get both a return code and a result set back from a stored procedure in classic ASP. CREATE PROCEDURE CheckEmployeeId @EmployeeName nvarchar(255) AS BEGIN SET NOCOUNT ON; DECLARE @Exists INT , @RowCount Int = 0 , @ReturnValue Int = 1 SELECT EmployeeId FROM Employees WHERE Name = @EmployeeName set @RowCount = @@ROWCOUNT if (@RowCount <> 1) BEGIN SET @ReturnValue = 2 END ELSE BEGIN SET @ReturnValue = 1 END RETURN @ReturnValue END So in ASP I can do the following to get the return

Return a value and a result set from stored procedure classic asp

拥有回忆 提交于 2019-12-01 21:14:01
I want to get both a return code and a result set back from a stored procedure in classic ASP. CREATE PROCEDURE CheckEmployeeId @EmployeeName nvarchar(255) AS BEGIN SET NOCOUNT ON; DECLARE @Exists INT , @RowCount Int = 0 , @ReturnValue Int = 1 SELECT EmployeeId FROM Employees WHERE Name = @EmployeeName set @RowCount = @@ROWCOUNT if (@RowCount <> 1) BEGIN SET @ReturnValue = 2 END ELSE BEGIN SET @ReturnValue = 1 END RETURN @ReturnValue END So in ASP I can do the following to get the return value Set cmd = CreateObject("ADODB.Command") with cmd .ActiveConnection = cnnstr .CommandType =

ADODB Connection String for .csv

旧时模样 提交于 2019-12-01 14:14:12
I want to process .csv files with ADODB in Excel VBA. I tried a few strings found on web, but none of them seems to work. I'm getting file path using: strVFile = Application.GetOpenFilename("CSV (*.csv), *.csv") And then I pass strVFile as a parameter to the sub objReport.Load strVFile . The header of the sub is: Public Sub Load(ByVal strFilename As String) . Then I try to make ADODB connection using string: pconConnection.ConnectionString = _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFilename & _ ";Extended Properties=""text;HDR=Yes;FMT=Delimited(;)"";Persist Security Info=False"

How to return multiple recordsets in a single execution using ADODB?

你。 提交于 2019-12-01 08:12:04
I need to iterate through multiple recodsets produced by a single query. However my current connection does not seem to support doing this. So when I do .NextRecordset I get the message: Current provider does not support returning multiple recordsets from a single execution This is my connection string: DB_CONNECTION = "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Forecasting;Integrated Security=SSPI;" Call Conn.Open(DB_CONNECTION) What must I do to be able to use .NextRecordset? jonno Set the CursorLocation to adUseServer (instead of 'client side' ) Set RS = New ADODB.Recordset

PHP interpreter gets undefined constant OCI_COMMIT_ON_SUCCESS with ADODB

假装没事ソ 提交于 2019-12-01 06:34:15
I wrote a php script that must be run on the php interpreter (Without Apache), which uses the adodb library with an Oracle database, but when I try to run it, I'm getting the following error: PHP Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS' in c:\proyect\backend\libraries\adodb\adodb.inc.php on line 4248 I've checked, and have both the php_oci8 and php_oci8_11g enabled, so the constant SHOULD be defined. Also, when I run this script WITH Apache, it works without any problems. Thanks in advance! After a quick search I found this page . If you don't

How to return multiple recordsets in a single execution using ADODB?

a 夏天 提交于 2019-12-01 05:39:01
问题 I need to iterate through multiple recodsets produced by a single query. However my current connection does not seem to support doing this. So when I do .NextRecordset I get the message: Current provider does not support returning multiple recordsets from a single execution This is my connection string: DB_CONNECTION = "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Forecasting;Integrated Security=SSPI;" Call Conn.Open(DB_CONNECTION) What must I do to be able to use .NextRecordset?