adodb

ADODB Connection String: Workgroup Information file is Missing?

随声附和 提交于 2019-11-29 04:50:45
I have a few data sources in access that I need to connect to programatically to do things with behind the scenes and keep visibility away from users. Said datasource has a password 'pass' as I'm going to call it here. Using this connection method I get an error attempting to use the open method Dim conn as ADODB.Connection Set ROBBERS.conn = New ADODB.Connection conn.open "Provider=Microsoft.Jet.OLEDB.4.0;" _ & "Data Source=\\pep-home\projects\billing\autobilling\DPBilling2.mdb;" _ & "Jet OLEDB:Database Password=pass;", "admin", "pass" "Cannot start your application. The workgroup information

Why can't I do a “with x as (…)” with ADODB and Oracle?

与世无争的帅哥 提交于 2019-11-29 04:17:50
I fail to execute an SQL query with a with clause via ADODB and Oracle. That is, the following snippet works: Dim cn As ADODB.connection Set cn = .... Dim rs As ADODB.recordSet Set rs = New ADODB.Recordset rs.Open "select 'foo' x from dual", cn Do While Not rs.eof ... rs.MoveNext Loop However, the following doesn't work - it genererats a Run-Time error 3704: Operation is not allowed when the object is closed. Dim cn As ADODB.connection Set cn = .... Dim rs As ADODB.recordSet Set rs = New ADODB.Recordset rs.Open "with w as (select 'foo' x from dual) select x from w", cn Do While Not rs.eof ...

ADODBCould not load type 'ADODB.FieldsToInternalFieldsMarshaler' from assembly

梦想的初衷 提交于 2019-11-28 21:18:14
I'm trying to read an ADOBD.Recordset object like this (my first time, so pardon my "noobness" :D): Presentation.Category categorySvc = new Presentation.Category(); ADODB.Recordset categories = categorySvc.ListAll("BE", "DUE", "EN", 128); foreach (var category in categories.Fields) // here is where I get the exception { // ... } The ListAll call works fine - I get the Recordset with some data which I confirm that by doing a QuickWatch on the object. But when the code reach the categories.Fields I get the following exception: Could not load type 'ADODB.FieldsToInternalFieldsMarshaler' from

Operation is not allowed when the object is closed (Object is not closed)

心不动则不痛 提交于 2019-11-28 12:44:31
问题 The following code, is generating that error. Set getList = Server.CreateObject("ADODB.Command") getList.ActiveConnection=EV_WikiConn getList.Prepared = true getList.commandtext= "declare @Lookup table(Id int identity(1, 1) , SongTitle nvarchar(512) ) insert into @Lookup(SongTitle)select * from ( values ('Deuce')) as x(a) select A.AlbumName, S.SongTitle , S.Writers , S.Vocals , S.SID , S.TheTime from Albums A inner join Songs S on A.AID = S.AID inner join @Lookup L on L.SongTitle = S

Fast update of Access data with Excel data using Excel VBA

邮差的信 提交于 2019-11-28 11:29:41
问题 By "fast" I mean using the UPDATE SQL query as opposed to looping through every recordset. Here I found this nice query: ''Batch update (faster) strSQL = "UPDATE [;Database=c:\Docs\DBFrom.mdb;].Table1 t " _ & "INNER JOIN [Sheet7$] s " _ & "ON s.id=t.id " _ & "SET t.Field1=s.Field1 " _ & "WHERE s.Field1<>t.Field1 " cn.Execute strSQL However, this example is used while connected from Access VBA to pull data from Excel to Access. In my case I would need to connect from Excel VBA and using data

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered in the local machine [closed]

半城伤御伤魂 提交于 2019-11-28 11:07:46
I'm getting this error when trying to run a vb application on a another pc. Is there some place I can download this DLL? http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en I had already done that by using AccessDatabaseEngine_x64 as the server is 64 bit - Please see for reference Microsoft Access Database Engine 2010 Redistributable http://www.microsoft.com/downloads/en/details.aspx?FamilyID=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=en Veli Gebrev I ran into the issue of still getting the error after installing the Office 2007

VBA New Database Connection

半世苍凉 提交于 2019-11-28 07:52:13
How to change the code below to prevent what you see in the screenshot. I am running a macro with the following code Dim conn As ADODB.Connection Dim rec1 As ADODB.Recordset Dim thisSql As String Set conn = New ADODB.Connection Dim sConn As String sConn = "Provider=SQLOLEDB;Trusted_Connection=Yes;Server=xyz;Database=xyz;UID=xyz;PWD=xyz" conn.Open sConn ' this is creating multiple connections. Set rec1 = New ADODB.Recordset rec1.Open thisSql, conn which runs a SQL Server query (which is around 20 lines long and contains 4 joins). Everything is fine except for the fact that after a couple times

Using “SELECT SCOPE_IDENTITY()” in ADODB Recordset

给你一囗甜甜゛ 提交于 2019-11-28 07:43:11
问题 Using a VBA script in Excel, I'm trying to insert a new row into a table and then get back the identity value of that row. If I run: INSERT INTO DataSheet(databaseUserID, currentTimestamp) VALUES (1, CURRENT_TIMESTAMP); SELECT SCOPE_IDENTITY() in Management Studio, the row is inserted and it gives me the returned identity value as expected. However, when I run the exact same query through a ADODB recordset in VBA, I'm having trouble. The row is indeed inserted, but I can't access the identity

associative array in vba like php

一世执手 提交于 2019-11-28 06:31:22
问题 I need your help for building analytics in Microsoft Excel using VBA. I have one data sheet with y columns and n lines Line Number Firstname Lastname Country Training Hours Training Status 1 John Smith USA 1 Completed 2 Henri Dupont France 1 Completed 3 Paul Walker USA 25 Incomplete 4 Ron Howard USA 10 Completed And I would like to use array like in php but using VBA For i = 1 To nblines If(array[i]["Country"] = "USA" And array[i]["Training Status"] = "Completed") Then myval = myval + array[i

Getting names of Access database tables with Matlab

冷暖自知 提交于 2019-11-28 05:03:02
问题 I'm trying to get a listing of all tables in an Access database using Matlab. I'm so far using an actxobject and can successfull run queries against the database, but all methods I've read here have failed. I consistently get the error message 'No read permission on MSysObjects'. The query runs fine within the Access-program, but the implementation of my program does not allow me to store the query there. So, my question is: Is there any way to list all the tables of an Access database