64 bit Wscript AND 64 bit Microsoft.ACE.OLEDB.12.0 - ms-access

I have 64 bit windows 10 (and 7), 64 bit wscript opening my script, and AccessDatabaseEngine_x64.
I cannot get things to work with everything running x64, though 32 bit wscript works fine. I have attempted this on several computers including a new windows install. I am always greeted with...
Script: C:\Users\ARoberts\Desktop\REPORTER\reporter_1.vbs
Line: 126
Char: 3
Error: Provider cannot be found. It may not be properly
installed.
Code: 800A0E7A
Source: ADODB.Connection
from the below VBSCRIPT connection method.
Set DBConn = CreateObject("ADODB.Connection")
With DBConn
.Provider = "Microsoft.ACE.OLEDB.12.0"
'.Properties("Extended Properties").Value = "Excel 12.0 Xml; ReadOnly=false; HDR=Yes;IMEX=1;"
.Open fso.BuildPath(CurrentDirectory, "DB.mdb")'xlsx")
End With
I have done countless hours of research on this and wonder if the driver simply isn't capable of playing nicely with x64-wscript. I have tried excel files, access databases, along with a preconfigured User DSN. My database is very large and requires a large amount of processing.
Please let me know what other information I can provide and I will update my question with it.

Related

Excel VBA Connection string to MySQL remote Database is not working

I have MySQL server installed on a remote machine.
I am trying to connect to it via excel VBA - i can succesfully connect to it through excels built-in database connection tools and copy the connection string, however, VBA hates that connection string. here is my code and the error
Dim conn As New ADODB.Connection
Dim sConnectionString As String
Set conn = New ADODB.Connection
sConnectionString = "ODBC;Driver={MySQL ODBC 5.3 ANSI Driver};Provider=MSDASQL;Server=AddressHere;Port=3306;Database=DatabaseName;User=UserName;Option=3"
conn.ConnectionString = sConnectionString
conn.Open
Here is the error messgae i get when it tries to connect, i have verified that the ODBC driver is installed.
Have you checked to make sure 32 bit vs 64 bit are all configured/installed? It gets a bit messy...
Based on personal experience with a very similar problem. 64 bit OS using 32 bit office install and 32 bit mySQL eventually made it work for me.. but different combinations can prove to be incompatible.
Don't think that your 64 bit OS means you need 64 bit mySQL if your Office install is 32 bit. Also keep in mind that if you use ODBC to connect, there are 32 bit and 64 bit versions of that too in your system.

LotusScript - How to connect to MySQL?

Sorry for possible dublicate.
I am trying to connect to my MySQL database from my LotusScript code (in some of my legacy projects):
Option Public
Option Declare
UseLSX "*LSXODBC"
Sub Initialize
Dim mysqlConnection As New ODBCConnection
Dim sqlQuery As New ODBCQuery
Dim result As New ODBCResultSet
Call mysqlConnection.ConnectTo("url","root","111111")
If Not mysqlConnection.IsConnected Then
MessageBox "No connection. Try again later."
Exit Sub
Else
MessageBox "Connection success."
End If
End Sub
I can't figure out what is the correct way to set the url of my database in LotusScript. I have already tried many variants of possible solutions, but nothing worked, also found many different urls, but also not helped.
Situation:
For example, I am trying to connect to my localhost MySQL base in port 3306 with name "test_db".
Question:
How must the url looks like for this?
p.s. also, if you have more possible ways to connect to MySQL DB from LotusScript - I will be very glad to see them.
Thanks.
As per the documentation for the ConnectTo method of ODBCConnetion class, you don't specify a URL. You specify a Data Source Name, otherwise known as a DSN. This is a name that you assign when you configure a connection in the 'Data Sources (ODBC)' tool on the Windows machine where the code will be executing.
On Windows 10, the 'Data Sources (ODBC)' tool is found in the Control Panel listed under Administrative Tools. On a Windows 2008 server that I happen to have handy, Administrative Tools is directly on the Start Menu. I'm sure they've hidden it in other places on other Windows versions. (I have a dim memory of it being under 'Accessories' on some versions.)
Note that on 64 bit versions of Windows, you need to be cognizant of whether your code is running in a 32 bit environment - as it is if it runs in the Notes client, or in a 64 bit environment, which it might be if it is running in background on a Domino server. There are separate 32 and 64 bit versions of the 'Data Sources (ODBC)' tool, and it does matter which one you use. If you're at all unsure, run them both and configure the same DSN name in each of them,

Error trying to connect to MySql using DSN

It has been a long time since using VB6 and I didn't use MySql or DSN connections then, but I'm working on a legacy application that uses these. When I try to open the connect I am getting a
Data source not found and no default driver specified with this code
Dim conn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
Dim sql As String
Set rs = New ADODB.Recordset
Set cmd = New ADODB.Command
Set conn = New ADODB.Connection
conn.Open "DSN=AddressHealthcheck" '<- Fails on this statement
I have also tried specifying the DSN in the conn.ConnectionString but get the same error.
The AddressHealthcheck exists in the local System DSN, uses the MySql ODBC 5.1 Driver and connects successfully when tested.
I'm sure (and hope) I missing something obvious. Any suggestions?
Thanks,
Kevin
I use a DSN-less ODBC stored in a UDL. It's basically a file with a connection string in it. Maybe the connection string will be of use. Here's an example:
[oledb]
; Everything after this line is an OLE DB initstring
Provider=MSDASQL.1;Persist Security Info=True;Extended Properties="Driver=MySQL ODBC 5.1 Driver;SERVER=mysqlsvr;UID=userid;PWD=password;DATABASE=mydatabase;PORT=3306;OPTION=18475";Initial Catalog=mydatabase
rags comment (above) wasn't the solution, but it definitely helped track it down.
When using a full connection string the error message was different and much more useful, the driver failed to load.
The issue seems to be that since I'm on a 64 bit machine it was the 64 bit driver. VB6 can't use the 64 bit driver and the 32 bit driver doesn't show up in the ODBC Connection Administrator on a 64 bit machine.
DSN is not an option in my machine.
There are two ODBC Admin tools in a 64-bit system. Run the 32-bit version. Or better yet drop ODBC and get an OLEDB Provider for MySQL.
I was researching this by 1 labour day (yesterday). Today I've realized some errors I had yesterday in order to have this working.
Dim conexion As New ADODB.Connection
conexion.ConnectionString = "DSN = yourDsnName"
conexion.open
Don't forget to...
Create a user in your mysql server that has all the priviledges you need.
Assign the server's name or ip from where it is going to connect to mysql
Create your dsn on the client machine with the correct options en test it.

VBA/MySQL issue using ODBC connector

I have been struggling with this for a few days now. Any help much appreciated.
Trying to connect to MySQL database using Excel VBA, on a PC with the following:
Excel 2007
Windows 7 x64 Home Premium
MySQL 5.5
MySQL ODBC Connector 5.1, 64 bit
In the Excel VBA I have referenced Microsoft ActiveX Objects 2.8 Library.
The VBA I am using to connect is:
Dim oConn As ADODB.Connection
Public Sub ConnectDB()
Set oConn = New ADODB.Connection
oConn.Open "DRIVER={MySQL ODBC 5.1 Driver};" & "SERVER=localhost;" & "DATABASE=test;" & "USER=root;" & "PASSWORD=PWhere;" & "Option=3"
End Sub
Every time I run this I get the error dialog: "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
MySQL service is definitely running.
I have used Windows Data Source Administrator to check that MySQL ODBC Connector 5.1 is present and correct: it is, checks out OK when I try to create a DSN in this way.
Looking through the VBA project reference options, I note the options to reference a whole host of different ADO Libraries, including (Multi-dimensional) options and library versions 2.0,2.1,2.5,2.6,2.7, and 6.0 - maybe the answer lies in one of these?
Any more details required, let me know.
You need to use either the 32 or 64 bits version depending on the version of Excel, not Windows. So even if you run Windows 7 64 bits, I believe Excel 2007 only comes in 32 bits so you would need to use the 32 bits mysql connector.
See also this bug report that is similar to your issue.
I got similar message when moved my application to other system with different version of driver - it looks like misspelled driver name causes identical message. To find correct driver name and make application driver version independent I use the following code:
Public Function Get_Driver() As String
Const HKEY_LOCAL_MACHINE = &H80000002
Dim l_Registry As Object
Dim l_RegStr As Variant
Dim l_RegArr As Variant
Dim l_RegValue As Variant
Get_Driver = ""
Set l_Registry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
l_Registry.enumvalues HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers", l_RegStr, l_RegArr
For Each l_RegValue In l_RegStr
If InStr(1, l_RegValue, "MySQL ODBC", vbTextCompare) > 0 Then
Get_Driver = l_RegValue
Exit For
End If
Next
Set l_Registry = Nothing
End Function

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

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%\System32\odbcad32.exe to try to configure the Driver in 32bit mode, but it hasn't done the trick. Any suggestions would be greatly appreciated
Just as an addition, I'm trying to get this .vbs script to run by double clicking and letting it do it's thing. This code isn't embedded into another lang/script.
run script with SysWOW64 version
C:\Windows\SysWOW64\wscript.exe or cscript
instead of the default 64bit version from C:\Windows\System32
On Microsoft TechNet Configuring IIS to Run 32-bit Applications on 64-bit Windows (IIS 6.0):
To enable IIS to run 32-bit applications on 64-bit Windows:
Open a command prompt and navigate to the %systemdrive%\Inetpub\AdminScripts directory.
Type the following command:
cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 "true"
Press ENTER.
Alternatively, via Internet Information Services (IIS) Manager:
Access Application Pools
Right click on "ASP.NET v4.0 Classic"
Select "Set Application Pool Defaults ..."
Under General change "Enable 32-Bit Applications" from "False" to "True"
Click OK
If you wish to run both 32-bit and 64-bit applications, there's various blogs to do it, such as Rakki Muthukumar's blog IIS7 - Running 32-bit and 64-bit ASP.NET versions at the same time on different worker processes.
Alternatively, via Internet Information Services (IIS) Manager:
Access Application Pools
Right click on "ASP.NET v4.0 Classic"
Select "Set Application Pool Defaults ..."
Under General change "Enable 32-Bit Applications" from "False" to "True"
Click OK
When I change this settings it is worked. thank you guys.. :)
Just use
strConnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= "
if you 've all needed drivers
I used this it worked for me without any error:
sconnect = "Provider=MSDASQL.1;DSN=Excel Files;DBQ=" & myPath & ";HDR=Yes';"
Set con = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
con.Open sconnect
sSQLQry = "SELECT * FROM [" & tableName & "];"
Set rs = con.Execute(sSQLQry)
we had same issue where we were getting exception
Provider cannot be found. It may not be properly installed
with following machine configuration:-
machine:- window 10
oracle client installed:- oracle 12c
provider:- MSDAORA.Oracle (instead of OraOledb)
we have read number of blogs to resolve this where every post saying configuration issue between oracle client 12 to 11G version having 62 to 32bit inter dependency and lot more but it got resolved while changing the provider name from capital letter to small.
earlier provider name was:- MSDAORA.Oracle (Here Oracle "O" is in capital letter )
now provider name is:- MSDAORA.oracle (Here oracle "O" is in small letter )
please give a try, if that works for you :)
Check this out
EDIT: Warning, the link below goes straight to a download of 2007 Office System Driver: Data Connectivity Components.
http://www.microsoft.com/download/en/confirmation.aspx?id=23734
Installed it, read the instruction and everything worked as a charm.