Hello,
I have a small VBA Excel app that queries an Oracle database.
Certain tables I hit are quite large, and queries on these large tables (with their associated large datasets) cause the following error:
"Run-time error 3146"
"ODBC call failed"
Googling leads me to believe that this is some sort of timeout problem.
Here is the code I use (in part, all variables are appropriately dim'd):
[code]
strSQL = strSelect & strFrom & strWhere & strAnd & strMachines & strGroupBy
Set qdfData = dbMyDB.CreateQueryDef("", strSQL)
strMyServer = "myserver" & ";"
strDBConn = "ODBC;DRIVER={Oracle in OraHome92};SERVER=" & strMyServer
qdfData.Connect = strDBConn & "UID=user_id;DBQ=" & strMyServer & "pwd=password;"
[/code]
I don't have a problem with queries of small tables, only the large ones.
I read that it's possible to set connection.timeout = 0 to avoid this error, but I am VERY new to VBA and don't know how to incorporate that into this code.
Any help is appreciated.

VBA Excel/Oracle query and run-time error 3146
Koolchamp
Per our support engineer:
How-to: Connecting to Oracle from VBA
http://www.marcel-jan.nl/oracle/tips/oracle_tip_vba.html
http://msdn.microsoft.com/library/default.asp url=/library/en-us/iissdk/html/39eaa2b1-1a9c-4dbe-b889-494759fa9115.asp
http://msdn.microsoft.com/library/en-us/ado270/htm/mdproconnectiontimeout.asp
http://msdn.microsoft.com/library/en-us/ado270/htm/mdprocommandtimeout.asp
http://msdn.microsoft.com/library/default.asp url=/library/en-us/ado270/htm/mdproconstringx.asp
http://msdn.microsoft.com/archive/default.asp url=/archive/en-us/dnaraccessdev/html/ODC_MicrosoftOfficeDeveloperForumAccessAdvancedADOfortheVBAProgramme.asp
http://msdn.microsoft.com/library/en-us/oledb/htm/oledbctprovider_connection_string_for_ado.asp
Access: Call an Oracle stored procedure using VBA code
http://www.techonthenet.com/access/queries/passthrough3.php
http://msdn.microsoft.com/library/en-us/vbaac11/html/achowSQLStringVBA_HV05187046.asp
-brenda (ISV Buddy Team)