Z
zacharybass
Hello All:
My form collects Oracle UIDs and Passwords and runs a process of about
20 queries, most of which are either exclusively Oracle (SPT) or
exclusively Access. For the SQL Pass Throughs I connect using:
Sub Open_cnn1(uid As String, pwd As String)
'// Open connection to ED
cnn1.Provider = "OraOLEDB.Oracle"
cnn1.ConnectionString = "Data Source=DSN" & ";User ID=" & uid &
";Password=" & pwd
cnn1.Open
End Sub
'// Run Oracle SPT and append records to local table.
Sub equity_append(rpt_date As String)
Dim rst1 As New ADODB.Recordset
Dim rst2 As New ADODB.Recordset
Dim recTable As Recordset
Dim strSQL As String
rst1.CursorLocation = adUseClient
strSQL = "SELECT a.MT_RCE_ORG_ID, a.MT_LOAN_SUB_TYPE, "
strSQL = strSQL & "DECODE(a.MT_LOAN_SUB_TYPE,'00','HEL',
'38','HELOC') as EQTY_PROD, "
strSQL = strSQL & "Count(a.CASE_NUMBER) as EQTY_COUNT, "
strSQL = strSQL & "Sum(a.MT_LOAN_AMOUNT) as EQTY_VOL, "
strSQL = strSQL &
"DECODE(a.MT_LOAN_SUB_TYPE,'00',Sum(a.MT_LOAN_AMOUNT *.0375),'38',
Sum(a.MT_LOAN_AMOUNT *.018)) as EQTY_REV, "
strSQL = strSQL & "a.REPORT_PERIOD "
strSQL = strSQL & "FROM PROFOWNER.PROF_MT_DAILY_PRICING_DATA_NEW
a, MTFOWNER.MTF_CUST_VIEW b, ICPOWNER.ICP_ED_ORG_MANAGERIAL_VW c "
strSQL = strSQL & "And b.MTF_PRODUCT_OPTION <> '130' "
strSQL = strSQL & "And a.REPORT_PERIOD = TO_DATE(" & rpt_date & ",
'MM/DD/YYYY') "
strSQL = strSQL & "GROUP BY a.MT_RCE_ORG_ID, a.MT_LOAN_SUB_TYPE,
a.REPORT_PERIOD "
rst1.CursorLocation = adUseClient
rst1.Open strSQL, cnn2
rst2.Open "tbl_equity_all", CurrentProject.Connection,
adOpenKeyset, adLockOptimistic
rst1.MoveFirst
Do While Not rst1.EOF
rst2.AddNew
For k = 0 To rst1.Fields.Count - 1
rst2.Fields(k).Value = rst1.Fields(k).Value
rst2.Update
Next k
rst1.MoveNext
Loop
End Sub
And for the Access queries I use (Docmd.OpenQuery "queryname").
However, I do have one update query late in the process where an
Oracle table is joined to a local Access table. As a result, the user
is prompted with the Oracle ODBC Driver Connect form thus interupting
the process. How can I avoid this? I want to create all necessary
connections through the form on the front end. I thought that either
using the existing connection or establishing a new one would work,
but I have not had any success. Any help/explanation would be very
much appreciated.
Zachary
My form collects Oracle UIDs and Passwords and runs a process of about
20 queries, most of which are either exclusively Oracle (SPT) or
exclusively Access. For the SQL Pass Throughs I connect using:
Sub Open_cnn1(uid As String, pwd As String)
'// Open connection to ED
cnn1.Provider = "OraOLEDB.Oracle"
cnn1.ConnectionString = "Data Source=DSN" & ";User ID=" & uid &
";Password=" & pwd
cnn1.Open
End Sub
'// Run Oracle SPT and append records to local table.
Sub equity_append(rpt_date As String)
Dim rst1 As New ADODB.Recordset
Dim rst2 As New ADODB.Recordset
Dim recTable As Recordset
Dim strSQL As String
rst1.CursorLocation = adUseClient
strSQL = "SELECT a.MT_RCE_ORG_ID, a.MT_LOAN_SUB_TYPE, "
strSQL = strSQL & "DECODE(a.MT_LOAN_SUB_TYPE,'00','HEL',
'38','HELOC') as EQTY_PROD, "
strSQL = strSQL & "Count(a.CASE_NUMBER) as EQTY_COUNT, "
strSQL = strSQL & "Sum(a.MT_LOAN_AMOUNT) as EQTY_VOL, "
strSQL = strSQL &
"DECODE(a.MT_LOAN_SUB_TYPE,'00',Sum(a.MT_LOAN_AMOUNT *.0375),'38',
Sum(a.MT_LOAN_AMOUNT *.018)) as EQTY_REV, "
strSQL = strSQL & "a.REPORT_PERIOD "
strSQL = strSQL & "FROM PROFOWNER.PROF_MT_DAILY_PRICING_DATA_NEW
a, MTFOWNER.MTF_CUST_VIEW b, ICPOWNER.ICP_ED_ORG_MANAGERIAL_VW c "
strSQL = strSQL & "And b.MTF_PRODUCT_OPTION <> '130' "
strSQL = strSQL & "And a.REPORT_PERIOD = TO_DATE(" & rpt_date & ",
'MM/DD/YYYY') "
strSQL = strSQL & "GROUP BY a.MT_RCE_ORG_ID, a.MT_LOAN_SUB_TYPE,
a.REPORT_PERIOD "
rst1.CursorLocation = adUseClient
rst1.Open strSQL, cnn2
rst2.Open "tbl_equity_all", CurrentProject.Connection,
adOpenKeyset, adLockOptimistic
rst1.MoveFirst
Do While Not rst1.EOF
rst2.AddNew
For k = 0 To rst1.Fields.Count - 1
rst2.Fields(k).Value = rst1.Fields(k).Value
rst2.Update
Next k
rst1.MoveNext
Loop
End Sub
And for the Access queries I use (Docmd.OpenQuery "queryname").
However, I do have one update query late in the process where an
Oracle table is joined to a local Access table. As a result, the user
is prompted with the Oracle ODBC Driver Connect form thus interupting
the process. How can I avoid this? I want to create all necessary
connections through the form on the front end. I thought that either
using the existing connection or establishing a new one would work,
but I have not had any success. Any help/explanation would be very
much appreciated.
Zachary