# Solved: Windows 2007 and DAO 3.6-Run time error 3146



## urwethe (Jul 28, 2004)

Hi,

Running VBA 6.5 (within Excel 2007 macro), accessing ODBC DSN for Oracle Database 10.2. 
Using DAO 3.6
Windows XP Professional
Works perfect.

Using Windows 2007
Run-time error '3146'
ODBC -call failed

Test connection is successful in Oracle ODBC Driver Configuration

Here is my code, please help!!! 

Set wrkODBC = CreateWorkspace("", "", "", dbUseODBC)
wrkODBC.DefaultCursorDriver = dbUseClientBatchCursor
'If wrkODBC Is Nothing Then ConnectDatabase = False
Set db = wrkODBC.OpenDatabase("EBSPROD", dbDriverNoPrompt, False, "ODBC;DATABASE=;UID=bouser;PWD=xxxxx;DSN=EBSPROD")


----------



## urwethe (Jul 28, 2004)

I have additional information.

?fncODBCErrors
|0 IM014: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application|3146 ODBC--call failed.|

I got this from this function:

Function fncODBCErrors() As String

Dim strODBCErrors As String
Dim intI As Integer

' Collect ODBC errors (if any) for reporting.
strODBCErrors = vbNullString
With DBEngine.Errors
For intI = 0 To (.Count - 1)
strODBCErrors = strODBCErrors & "|" & _
.Item(intI).Number & " " & _
.Item(intI).Description
Next intI
End With
If Len(strODBCErrors) > 0 Then
strODBCErrors = strODBCErrors & "|"
End If

fncODBCErrors = strODBCErrors

End Function


----------



## urwethe (Jul 28, 2004)

When you create the DSN, you need to use C:\Windows\SysWOW64\odbcad32.exe. Instead of C:\Windows\system32\odbcad32.exe. The DSN created by latter odbcad32.exe is for 64 bit application use.


----------

