Click here to Skip to main content
15,881,820 members
Home / Discussions / Database
   

Database

 
GeneralRe: oracle boolean ? Pin
Jwalant Natvarlal Soneji7-Oct-07 21:33
Jwalant Natvarlal Soneji7-Oct-07 21:33 
NewsMessage Closed Pin
5-Oct-07 7:51
SQL Gurus5-Oct-07 7:51 
GeneralRe: SQL Server Community Launched Pin
Dave Kreskowiak5-Oct-07 10:40
mveDave Kreskowiak5-Oct-07 10:40 
GeneralRe: SQL Server Community Launched Pin
Christian Graus5-Oct-07 23:55
protectorChristian Graus5-Oct-07 23:55 
GeneralRe: SQL Server Community Launched Pin
Dave Kreskowiak6-Oct-07 2:48
mveDave Kreskowiak6-Oct-07 2:48 
GeneralRe: SQL Server Community Launched Pin
Pete O'Hanlon7-Oct-07 11:12
mvePete O'Hanlon7-Oct-07 11:12 
GeneralRe: SQL Server Community Launched Pin
Paul Conrad7-Oct-07 11:07
professionalPaul Conrad7-Oct-07 11:07 
QuestionAssigning the value from a QueryDef object... Pin
new_phoenix5-Oct-07 6:21
new_phoenix5-Oct-07 6:21 
I would like to be able to assign the value from a created QueryDef object to a modifiable recordset object variable. How do I go about doing this? The Microsoft documentation does not provide any explanations.

Here is the code so far:

Private Sub ProcessHeadcountRecords()
    Dim dbsHeadcount As Database
    Dim Cnxn As ADODB.Connection
    Dim strConn As String
    Dim rstInputFile As ADODB.Recordset
    Dim cmdSQLInputFile As ADODB.Command
    Dim strSQLInputFile As String
    Dim rstHyperionMany As ADODB.Recordset
    Dim cmdSQLHyperionMany As ADODB.Command
    Dim strSQLHyperionMany As String
    Dim rstHyperionOne As ADODB.Recordset
    Dim cmdSQLHyperionOne As ADODB.Command
    Dim strSQLHyperionOne As String
    Dim qdfNew As QueryDef
    Dim strDBPath As String
    Dim strFileName As String
    Dim strMessage As String
    
    strDBPath = "J:\GELCO DATABASE\Headcount Database\Headcount Database.mdb"
    Set dbsHeadcount = OpenDatabase(strDBPath)
    Set Cnxn = New ADODB.Connection
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
        "Data Source=" & strDBPath & ""
    Cnxn.Open strConn
    
    Set rstInputFile = New ADODB.Recordset
    strSQLInputFile = "SELECT [COUNTRY], [TYPE], [BUSINESS_UNIT], " & _
        "[L_R_G], [REGION], [JOB_FUNCTION], [ACTUAL], [NUMINDEX] " & _
        "FROM TBLINPUTFILE"
    rstInputFile.Open strSQLInputFile, Cnxn, adOpenKeyset, adLockOptimistic
    rstInputFile.MoveFirst
    
    Set rstHyperionMany = New ADODB.Recordset
    strSQLHyperionMany = "SELECT [COUNTRY], [TYPE], [BUSINESS_UNIT], " & _
        "[L_R_G], [REGION], [JOB_FUNCTION], [NUMFOREIGNKEY] " & _
        "FROM [TBLHYPERIONMANY2] ORDER BY [NUMFOREIGNKEY]"
    rstHyperionMany.Open strSQLHyperionMany, Cnxn, adOpenKeyset, adLockOptimistic
    
    strFileName = "qryPassThroughQuery"
    Do Until rstInputFile.EOF
        With dbsHeadcount
            strSQLHyperionMany = "SELECT [COUNTRY], [TYPE], " & _
                "[BUSINESS_UNIT], [L_R_G], [REGION], [JOB_FUNCTION], [NUMFOREIGNKEY] " & _
                "FROM [TBLHYPERIONMANY2] " & _
                "WHERE [COUNTRY]='" & UCase(rstInputFile![COUNTRY]) & "' " & _
                "AND [TYPE]='" & UCase(rstInputFile![Type]) & "' " & _
                "AND [BUSINESS_UNIT]='" & UCase(rstInputFile![BUSINESS_UNIT]) & "' " & _
                "AND [L_R_G]='" & UCase(rstInputFile![L_R_G]) & "' " & _
                "AND [REGION]='" & UCase(rstInputFile![REGION]) & "' " & _
                "AND [JOB_FUNCTION]='" & UCase(rstInputFile![JOB_FUNCTION]) & "'"
            rstHyperionMany.Requery
            Set qdfNew = dbsHeadcount.CreateQueryDef(strFileName, strSQLHyperionMany)
            DoCmd.SetWarnings False
            'If rstInputFile.RecordCount = 1 Then
                rstInputFile![NUMINDEX] = QueryDefs![strFileName]![NUMFOREIGNKEY]  /// I DO NOT KNOW THE SYNTAX HERE TO ADDRESS THE QUERYDEF OBJECT!!! PLEASE HELP!!!
            'Else
                'MsgBox ("Record not found")
            'End If
            'prgProgressBar.Value = prgProgressBar.Value + 1
        End With
        dbsHeadcount.QueryDefs.Delete strFileName
        rstInputFile.MoveNext
    Loop
End Sub



-- modified at 13:21 Friday 5th October, 2007
Questionneed to use CrossJoin, and find differnece in Columns Pin
The Don Man5-Oct-07 6:13
The Don Man5-Oct-07 6:13 
QuestionDescription for various tables elements Pin
Brendan Vogt5-Oct-07 6:09
Brendan Vogt5-Oct-07 6:09 
AnswerRe: Description for various tables elements Pin
Jwalant Natvarlal Soneji7-Oct-07 21:36
Jwalant Natvarlal Soneji7-Oct-07 21:36 
QuestionStored Procedures Pin
kibromg5-Oct-07 4:12
kibromg5-Oct-07 4:12 
AnswerRe: Stored Procedures Pin
Michael Potter5-Oct-07 4:39
Michael Potter5-Oct-07 4:39 
GeneralRe: Stored Procedures Pin
kibromg5-Oct-07 4:53
kibromg5-Oct-07 4:53 
GeneralRe: Stored Procedures Pin
Michael Potter5-Oct-07 5:36
Michael Potter5-Oct-07 5:36 
GeneralRe: Stored Procedures Pin
kibromg5-Oct-07 6:05
kibromg5-Oct-07 6:05 
GeneralRe: Stored Procedures Pin
Michael Potter5-Oct-07 8:50
Michael Potter5-Oct-07 8:50 
GeneralRe: Stored Procedures Pin
GuyThiebaut5-Oct-07 9:07
professionalGuyThiebaut5-Oct-07 9:07 
QuestionTool to generate data Pin
matthias s.5-Oct-07 3:16
matthias s.5-Oct-07 3:16 
QuestionTO STORE IMAGES FROM FOLDER TO DATA BASE Pin
kishoregani5-Oct-07 2:39
kishoregani5-Oct-07 2:39 
AnswerRe: TO STORE IMAGES FROM FOLDER TO DATA BASE Pin
Christian Graus5-Oct-07 2:52
protectorChristian Graus5-Oct-07 2:52 
AnswerRe: TO STORE IMAGES FROM FOLDER TO DATA BASE Pin
Vasudevan Deepak Kumar5-Oct-07 3:39
Vasudevan Deepak Kumar5-Oct-07 3:39 
AnswerRe: TO STORE IMAGES FROM FOLDER TO DATA BASE Pin
Paul Conrad7-Oct-07 11:09
professionalPaul Conrad7-Oct-07 11:09 
QuestionUpdating one Dataset from another Dataset. Pin
Hemant.Kamalakar5-Oct-07 2:11
Hemant.Kamalakar5-Oct-07 2:11 
AnswerRe: Updating one Dataset from another Dataset. Pin
Kschuler5-Oct-07 6:18
Kschuler5-Oct-07 6:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.