cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Simba Spark Driver fails for big datasets in Excel

pvalcheva
New Contributor

pvalcheva_0-1750755864726.png

Hello, I am getting the following error when I want to extract data from Databricks via VBA code. The code for the connection is:

Option Explicit

Const adStateClosed = 0

Public CnAdo As New ADODB.Connection
Dim DSN_name As String
Dim WB As Workbook
Dim dashWS As Worksheet
Dim sqlWS As Worksheet

Public Sub Check_CnAdo_Open()

' Set workbook and worksheet references
Set WB = ThisWorkbook
Set dashWS = WB.Sheets("Dashboard")
Set sqlWS = WB.Sheets("Dashboard") ' Change if needed

' Read DSN name from Dashboard named cell
DSN_name = dashWS.Range("DSN_name").Value

' Only open if not already open
If CnAdo.State = adStateClosed Then
CnAdo.ConnectionString = _
"DSN=" & DSN_name & ";" & _
"UseNativeQuery=1;" & _
"EnableResultCache=1;" & _
"SSL=1;" & _
"DisableCloudResultStorage=1;"

CnAdo.CommandTimeout = 3600

On Error GoTo ErrHandler
CnAdo.Open
End If

Exit Sub

ErrHandler:
MsgBox "Connection failed: " & Err.Description, vbCritical, "ODBC Connection Error"

End Sub

0 REPLIES 0

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now