Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using Office 2003 on Windows XP.
I am running the following code. This is running from a standard code module in Excel, querying Oracle, and making a table into an Access DB. The problem is, sometimes it runs fine, other times I get "ODBC Call Fails" error: Dim sSQL as String Dim sConnect as String Dim sFullNameDB as String sConnect = "PROVIDER=MSDASQL.1;DRIVER={ORACLE ODBC DRIVER};SERVER=MyServer;DBQ=MyDBQ;UID=***;PWD=***; " sFullNameDB = "C:\Temp\MyAccessDB.mdb" sSQL = "SELECT " sSQL = sSQL & "[GL].ACCTNO, " sSQL = sSQL & "[GL].ACCOUNT_DESC, " ....<OTHER SQL - REMOVED FOR THIS EXAMPLE... sSQL = sSQL & "INTO " sSQL = sSQL & "[IMPORT] " sSQL = sSQL & "FROM " sSQL = sSQL & "[ODBC;" & sConnect & "].[APPS.GLBALVW] AS [GL] " sSQL = sSQL & "WHERE " sSQL = sSQL & "[GL].PERIOD_NAME IN ('Sep-03', 'Sep-04') AND " sSQL = sSQL & "[GL].FUND BETWEEN '800' AND '999' AND " sSQL = sSQL & "[GL].ACCOUNT BETWEEN '0000' AND '8999';" Set cnADO = New ADODB.Connection cnADO.CommandTimeout = 0 cnADO.CursorLocation = adUseClient cnADO.Provider = "Microsoft.Jet.OLEDB.4.0" cnADO.ConnectionString = sFullNameDB cnADO.Open cnADO.Execute sSQL cnADO.Close Set cnADO = Nothing Please note I have timeout set to zero. Any help appreciated. Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Make a product that works | Excel Worksheet Functions | |||
Make table query will work in datasheet view but will not make tab | Excel Discussion (Misc queries) | |||
Make Table Query into Text File | Excel Programming | |||
Use Excel to make an update query to another database table? | Excel Discussion (Misc queries) | |||
Copy recordset from an Access "make table" query | Excel Programming |