Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using Office 2003 on Windows XP.
I am trying to query an Oracle Database from Excel and run a "make table" query into a csv text file. But, when I run the following code I get a run-time error ("Query input must contain at least one table or query"). Can someone please correct my SQL or ADO so I can get this running? Dim sSQL As String sSQL = "SELECT " sSQL = sSQL & "A.ACCTNO, " sSQL = sSQL & "A.ACCOUNT_DESC " sSQL = sSQL & "INTO " sSQL = sSQL & "[Text;Database=C:\Temp\;].TestFile#txt " sSQL = sSQL & "FROM " sSQL = sSQL & "[ODBC;" & sOracleConnection & ";].[APPS.GLBALVW] A " sSQL = sSQL & "WHERE " sSQL = sSQL & "A.PERIOD_NAME IN ('Sep-03', 'Sep-04') AND " sSQL = sSQL & "A.FUND BETWEEN '800' AND '999' AND " sSQL = sSQL & "A.ACCOUNT BETWEEN '0000' AND '8999';" With CreateObject("adodb.connection") .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Extended Properties=""Text;HDR=Yes;"";" & _ "Data Source=C:\Temp\;" .CursorLocation = 3 'adUseClient .Open .Execute sSQL .Close End With Thanks much in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Make table query will work in datasheet view but will not make tab | Excel Discussion (Misc queries) | |||
How do I make a web query file to download stock data? | New Users to Excel | |||
Use Excel to make an update query to another database table? | Excel Discussion (Misc queries) | |||
Importing Text File Based on Query | Excel Programming | |||
Copy recordset from an Access "make table" query | Excel Programming |