Advertisement
Advertisement
| 02.26.2008 at 05:41AM PST, ID: 23193409 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 02.26.2008 at 06:01AM PST, ID: 20984284 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: |
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim strConnect as string
...
'Pass through query
'make the connect string
'mstrDSN, mstrUID & mstrPWD are strings in my routine which contain the DSN
'User ID and Password for the connection respectively
strConnect = "ODBC;DSN=" & mstrDSN & ";UID=" & mstrUID & ";PWD=" & mstrPWD
'retrieve the SQL
'The system I am using stores the Oracle SQL in a Memo field in an Access table
'(tblPassthroughQueries) when I need to use the query I retrieve the SQL from the table and
'Substitute in values for the required parameters
strSQL = "SELECT qOSQL FROM tblPassThroughQueries WHERE qName='" & mrst!sAction & "'"
Set rst = mdb.OpenRecordset(strSQL, dbOpenSnapshot)
strPTQ = rst(0)
rst.Close
Set rst = Nothing
'Swap in TimeKey criteria
'Here a string called <TIMEKEY> is replaced with a date value (from mdatTK)
strPTQ = Replace(strPTQ, "<TIMEKEY>", "'" & UCase(Format(mdatTK, "dd MMM yyyy")) & "'")
'Some other replacements made here
If InStr(1, strPTQ, "<RXMUPK>") > 0 Then
'Swap in massive replacement clauses
strPTQ = Replace(strPTQ, "<RXMUPK>", RXMP("ULTIMATEPARENTKEY"))
strPTQ = Replace(strPTQ, "<RXMPK>", RXMP("PDH.PARTNERKEY"))
End If
'Create a temporay querydef
'This is where we prepare to send the SQL to the server
'Note that if you are not expecting to retrieve records you can set
'ReturnsRecords = False
Set qdf = mdb.CreateQueryDef("")
qdf.Connect = strConnect
qdf.ReturnsRecords = True
qdf.ODBCTimeout = 0
qdf.SQL = strPTQ
'Retrieve records
'Note for a non record retrieving statement use qdf.Execute
Set rst = qdf.OpenRecordset(dbOpenSnapshot)
qdf.Close
Set qdf = Nothing
|
| 02.26.2008 at 06:32AM PST, ID: 20984566 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: |
Function TestPerms(strUID As String, strPWD As String, blnRW As Boolean, strErr As String) As Boolean
'------------------------------------------------------------------------------------------------------------------
'Tests whether the user has read write permission to a table
'strUID - user ID
'strPWD - password
'blnRW - test what should be RW table (if true), present what should be an RO table if false
'--------------------------------------------------------------------------------------------------------------------
Dim cn As ADODB.Connection
Dim lngRA As Long
Const DS1 = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(PORT=1528)(HOST=xxxxxxx.xxx.xxxxxxx.com)))(CONNECT_DATA=(SERVICE_NAME=RRWU4)))"
'Const DS2 = "RRWU4"
Dim strCn As String
Dim strSQL As String
On Error GoTo proc_err
strCn = "Provider=OraOLEDB.Oracle;Data Source=" & DS1 & ";User Id=" & strUID & ";Password=" & strPWD & ";"
Set cn = New ADODB.Connection
If blnRW Then
strSQL = "UPDATE CR_STRESSPORTFOLIOHIS SET PARTNERKEY='HELLO' WHERE 1=2"
Else
strSQL = "UPDATE CR_PARTNERDETAILSHIS SET PARTNERKEY='HELLO' WHERE 1=2"
End If
cn.Open strCn
cn.Execute strSQL, lngRA
proc_exit_true:
TestPerms = True
proc_exit:
If Not cn Is Nothing Then
Set cn = Nothing
End If
Exit Function
proc_exit_false:
TestPerms = False
GoTo proc_exit
proc_err:
strErr = Err.Description
Resume proc_exit_false
End Function
|
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: |
Function TestPerms(strSQL_PT_Query) As Boolean
Dim cn As ADODB.Connection
Dim lngRA As Long
Dim strCn As String
Dim DS1 As String
Dim strUID As String
Dim strPWD As String
Dim strPort As String
Dim strHost As String
Dim strTNS As String
strUID = "OP_DSS" 'Oracle user ID
strPWD = "dssopl" 'Oracle password
strPort = "1549" 'Oracle Server Port
strHost = "OHOSORP12" 'Oracle Server Hostname
strTNS = "HOPSPP" 'Oracle Instance Name
DS1 = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(PORT=" & strPort & ")(HOST=" & strHost & ")))(CONNECT_DATA=(SID=" & strTNS & ")))"
On Error GoTo proc_err
strCn = "Provider=OraOLEDB.Oracle;Data Source=" & DS1 & ";User Id=" & strUID & ";Password=" & strPWD & ";"
Set cn = New ADODB.Connection
cn.Open strCn
cn.Execute strSQL_PT_Query, lngRA
proc_exit_true:
TestPerms = True
proc_exit:
If Not cn Is Nothing Then
Set cn = Nothing
End If
Exit Function
proc_exit_false:
TestPerms = False
GoTo proc_exit
proc_err:
strErr = Err.Description
Resume proc_exit_false
End Function
|