Is there a way I can execute a make table query from oracle data? Basically what I wanna do is select data from oracle and create a table from that recordset simply by executing a make table query. I was able to make the connection and create the recordset. But I don't know the syntax to SELECT data from the recordset into a new table. Here's what I have:
That returns an error that it can find the table or query.
Any help would be appreciated.
Code:
Sub importData()
Dim rstImportTemp As adodb.Recordset
Dim rstTemp As adodb.Recordset
Dim fld As adodb.Field
Dim sqlstmst$
Dim last_event_id&
Dim has_new_rec As Boolean
Dim rec_count&
'here is where I make my connection to Oracle
If chkImpt Then Exit Sub
Debug.Print sqlstmst
Set rstImportTemp = New adodb.Recordset
Set rstTemp = New adodb.Recordset
'----oracle
sqlstmst = "select c.CASE_ID, c.case_number " & _
"from oflc.case_data c " & _
"where c.application_id = 3 " & _
"and c.CASE_NUMBER like '%H%'"
rstImportTemp.Open sqlstmst, dvcon, adOpenForwardOnly, adLockReadOnly
DoCmd.RunSQL "SELECT rstImportTemp.FORM_ETA750_ID, rstImportTemp.CASE_NO INTO testTable FROM rstImportTemp;"
That returns an error that it can find the table or query.
Any help would be appreciated.