All Questions
Tagged with connection-string vba
113
questions
42
votes
8
answers
202k
views
Error: "Could Not Find Installable ISAM"
I've written some VBA code in an Excel workbook to retrieve data from an Access database in the same directory on a desktop. It works fine on my machine and several other machines running Windows XP, ...
15
votes
2
answers
29k
views
How to securely store Connection String details in VBA
I have an Excel Template that has hardcoded Ms Access MDB path in the VBA code used to connect to the Access tables and save, retrieve data.
I migrated the MS Access Database over to SQL Server with ...
12
votes
4
answers
93k
views
Excel VBA - connect to sql with a trusted connection (no uid/pwd)
Is there a way to have Excel connect to Sql Server using the current user's network windows authentication (trusted connection/integrated security)? I don't want to rely on a sql login or have a uid/...
8
votes
3
answers
22k
views
With VBA, find the version of the MySQL ODBC driver installed in Windows
Using Visual Basic for Applications, how can I find out which version of the MySQL ODBC driver is installed in Windows on a user's machine?
I have a Microsoft Access application that uses the MySQL ...
7
votes
2
answers
14k
views
How to set "Application Name" in ADODB connection string
In .NET I simply use Application Name = MyApp inside the connection string, but when using ADO connection through VBA the Activity Monitor of the SQL Server Management Studio always shows Microsoft ...
7
votes
1
answer
50k
views
Microsoft Excel Data Connections - Alter Connection String through VBA
I have a fairly straightforward question. I am trying to find a way to alter and change a connection string for an existing data connection in an excel workbook through VBA (macro code). The main ...
7
votes
1
answer
53k
views
Setting an ODBC connection string in VBA
I have created a macro that sends a new CommandText to an ODBC Connection in my Excel spreadsheet and then refreshes the table of results associated with the query. This has been working fine, but I'...
5
votes
2
answers
8k
views
MSOLEDBSQL Causes Error 3706: Provider Cannot Be Found
A client has for many years been using an Excel VBA application to interact with a SQL database. Recently the database has been upgraded from TLS 1.0 to TLS 1.2, which caused the connection from VBA ...
4
votes
2
answers
65k
views
Connection string for SQL Server 2014 Express (VBA)
I am trying figure out what needs to go in the connection string for SQL server via VBA.
This is the code I have right now,
Sub ConnectSqlServer()
Dim conn As ADODB.Connection
Dim rs As ...
4
votes
2
answers
5k
views
Find locations where connections are used Excel VBA
I have a raft of Excel 2013 workbooks that I have to refine, each with multiple sheets and multiple data connections and I am looking for a quick way to list:
connection name
connection string
...
3
votes
3
answers
41k
views
Excel VBA; Updating a connection string
I'm just trying to get VBA to update an OLEDB connection string. When I step through the code, I don't get any errors but the connection refresh fails and when I examine the connection string in the ...
3
votes
1
answer
2k
views
Excel internal database connection
I built a data entry UserForm to populate a worksheet that will serve as the raw database. The raw data requires further manipulation and analysis in order to be reported, so I set up a database ...
3
votes
1
answer
4k
views
Excel Data Connection to Active Directory [closed]
I want to create a data connection in excel-2007 that pulls the result of an active-directory query into a sheet in my workbook.
I see that I can do this with VBA but I agree with Rob here that it ...
2
votes
3
answers
35k
views
ADODB Connection String for .csv
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 (*....
2
votes
2
answers
12k
views
Provider cannot be found on Windows 7 64 bit
I am trying to run our very old application on Windows 7 64 bit. In this application we use our do template in which there are a Visual Basic scripts. I have a problem with database provider. This is ...
2
votes
3
answers
51k
views
Excel macro to change external data query connections - e.g. point from one database to another
I'm looking for a macro/vbs to update all the external data query connections to point at a different server or database. This is a pain to do manually and in versions of Excel before 2007 it ...
2
votes
2
answers
18k
views
Connection string for opening linked table Access -> SQL server (vba)
I've been looking for the answer as there are many similar questions, but haven´t found this particular case.
I have an SQL server, and an Access File (front-end). This Access file has linked tables, ...
2
votes
1
answer
4k
views
ODBC connection string for multi-tenant HANA database
What will be the connection string that can be used in EXCEL VBA to connect to multi-tenant HANA database ? Currently I am using the string mentioned below but getting 10709 error:-
connectionstring =...
2
votes
1
answer
193
views
TableDefs.Connect missing semicolon: "ODBCDRIVER=" instead of "ODBC;DRIVER="
Just noticed this morning that when I try to get the connection string from a SQL Server linked table in VBA, it starts with "ODBCDRIVER=" instead of "ODBC;DRIVER=". I am getting ...
2
votes
2
answers
1k
views
Microsoft Access: connecting to SQL Server via Active Directory username and password Trusted_Connection=no
I have a Microsoft Access Application which generates a connection string like:
Provider=SQLNCLI11;Server=servername;Database=db_name;Trusted_Connection=yes;
This works without any problem.
What I ...
2
votes
2
answers
422
views
Excel VBA to parse SQL Connection Strings
I have an Excel VBA that connects to a SQL DB using the connection strings, but I would like to know if it's possible to parse into the connection string from a cell? For instance, if I have SQLSVR1\...
2
votes
1
answer
2k
views
Speeding up refresh time for multiple PivotTables using a single external OLAP cube
I have an Office Data Connection (ODC) pointed at an OLAP cube stored on our company's server. The connection string is fairly straightforward:
Provider=MSOLAP.6;Integrated Security=SSPI;Persist ...
2
votes
2
answers
6k
views
Catastrophic Failure EXCEL VBA - error '-2147418113 (8000ffff)'
I am struggling to find relevant information on the
'run-time error '-2147418113 (8000ffff)' - Catastrophic Failure'
I am experiencing.
Sub GenerateAIA_Click()
Dim SQL_query, SQL_syntax, DB_path,...
2
votes
3
answers
10k
views
Connection to two (or more) sharepoint lists with ADODB
I can connect to a SharePoint list with ADODB this way :
Dim objCon As New ADODB.Connection
objCon.Open "Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=Yes;DATABASE=mysite/documents;LIST={...
2
votes
0
answers
1k
views
Do I need to install drivers to connect to remote MYSQL database from Excel 2010 via VBA?
I am trying to build an application for my team the connects to a mysql database in Excel through vba. Below is my code to connect to the mysql database but when it runs it returns the following error:...
2
votes
0
answers
1k
views
Connecting to remote mySQL via Excel VBA
Likely a dumb question but brain isn't piecing this together---
tl;dr: My main question is how do I choose the right parameters for my connection string? How do I determine what my driver should be? ...
2
votes
1
answer
449
views
MySQL to Excel VBA
I used following:
Excel 2013
MySQL version is 5.0.67
Windows 8 64 bit
When I connect MySQL via excel VBA (I do not need ODBC connection),I got the following error.
Error Description: [Microsoft][...
2
votes
1
answer
1k
views
Change Connection String via code [closed]
I have 9 sheets that connect to different tables in teradata, each time i have to enter my user name and password to refresh and get new set of data. could someone please advice how do i write a VBA ...
1
vote
2
answers
8k
views
How to specify "Service Name" in Oracle ODBC connection string
I have an Excel macro that has an Oracle database connection. When I call the macro, it fills out user name and password but not service name. User has to enter service name manually every time.
How ...
1
vote
2
answers
9k
views
Excel VBA Connect to IBM Db2
Currently, I'm trying to query a Db2 instance from VBA but am having hard time finding proper documentation or previous stack questions that provide complete answers.
When I run the below, I receive ...
1
vote
1
answer
3k
views
Connect to MySQL database from VBA without having MySQL installed
I can connect to a remote MySQL db from an Excel workbook on my machine no problem using the following connection string:
Driver={MySQL ODBC 5.1 Driver};Server=server;Database=database;user=user;...
1
vote
1
answer
591
views
Excel macro displays Type Mismatch error after upgrade to Office365
My macro works fine on a laptop with Windows 10 and Excel 2010. It also used to work fine on my desktop with Windows 10 and Excel 2010. Once my desktop got upgraded to Office 365, the macro throws a ...
1
vote
1
answer
9k
views
Oracle VBA connection string
How does one properly establish a connection string for integrating a macro-enabled PowerPoint to be able to query an Oracle database? I have seen many old youtube videos and online tutorials ...
1
vote
1
answer
1k
views
VBA Test Sql Connection String is Correct w/ Time Out
Trying to test a connection using the code below which works fine. However, when it encounters a invalid/bad connection string it takes a long time to return the error message that it cannot connect. ...
1
vote
2
answers
5k
views
IMEX=1 seems to have no effect
I use ADODB to pull data from Excel file to another Excel file without opening the source. I have a strong suspicion that the IMEX=1 parameter is not accepted in my connection. I start my connection ...
1
vote
1
answer
3k
views
VBA: Query With Excel Tables as the Datasource
I want to query the table, which consists of a named range, from VBA using SQL.
name id
Alpha 1
Beta 2
Gamma 3
I want to perform a query like, select Name from table1 where id =3 in VBA
Can someone ...
1
vote
3
answers
442
views
vb access database password
how can one create a password on a visual basic access database when you have a vb datagrid
1
vote
1
answer
44
views
"dbo_" Missing From DNS-Less Connected Tables
I've had a DNS-less connection to my SQL Servers for years... but all of a sudden some (not all) of the tables are coming across WITHOUT the "dbo_" in the table name. I need the "dbo_&...
1
vote
1
answer
1k
views
How to modify the existing SQL connection in excel workbook using c# and then refresh the data
I have Excel file which has SQL connection in workbook to fetch the data from SQL Server, I want to update the connection string using c# program but I am unable to get to the connection string value ...
1
vote
2
answers
1k
views
Query data from SQL to MS Access: Local Tables vs Pass-Through Tables
I've created an application that uses the following logic to query data from SQL to my MS Access App.
Using an ODBC connection I execute a stored procedure
Using This is assigned as a Pass-Through ...
1
vote
1
answer
2k
views
Connection string passing all values as text
I'm struggling with importing data into excel sheet from
text file with header line
Values in the text file are separated with tab, therefore I had to create Schema.ini file, which is saved in the ...
1
vote
1
answer
1k
views
Export from Excel to SQL: Login Failed for User
I'm trying to create a function within Excel that will write data to my remote SQL Server database with a click of a button. However, I keep getting an error telling me that that my login failed for ...
1
vote
2
answers
8k
views
Excel 2010 VBA/ADO connection error with XL source and text output
I am using Excel 2010 with a macro to access another daily spreadsheet to pull data for forming an FTP file of records. The specific problem I am having is a runtime connection error. The error I am ...
1
vote
2
answers
1k
views
Read SQL Server query for ADODB.Connection from external file or from variable
I have this Excel VBA code:
Sub ConnectSqlServer()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sConnString As String
Dim query As String
' Create the connection ...
1
vote
0
answers
126
views
VBA machine info and/or drivers available
We have some code in VBA that uses a connection string to open an MDB.
We have found that the connection string has to change depending on the machine - it seems that .Jet.4 is no longer available on ...
1
vote
0
answers
651
views
Calling a sql stored procedure from excel using a service account in the connection string
I am having a hard time calling a stored procedure in SQL using service account credentials in my excel application. I am specifying the userid and password in the connection string in the following ...
1
vote
1
answer
1k
views
ADO Recordset Not Returning Field Value With DSN; Does with Connection String
I have the following Function:
Function downloadsqltoexcel(conn As ADODB.Connection, sSQL As String, exceldestinationrangename As String, sqltablename As String, bDownload As Boolean, Optional ws As ...
1
vote
1
answer
2k
views
Excel VBA Connection to Oracle
I am trying to connect to Oracle XE 11.2 using VBA and Excel. Oracle is installed on the same machine as Excel. I have also installed the 32 bit client tools. I have tried various methods found online ...
1
vote
0
answers
1k
views
Excel External Data Connection crashing on other users
I have a tool.xlsx file that uses external data connection to Access DB (both are on a network drive, available to users with proper access rights). I have a vbscript (code below) that refreshes all ...
0
votes
1
answer
5k
views
Excel function with ADODB connection string to Access database
I've created below Excel function which connects to an access database with ADODB (approx 10k lines).
It generally works but there are two main issues:
It is unreliable: often it returns 0 while the ...