ToeJamNEarl
Programmer
Hey guys
How would I make it so that I can populate a table I make on the machine that I will have a key (used for ID of each record) associated with each record in the recordset?
Right now I am creating my recordset as follows:
DBConnection is already made the connection to the ORacle DB.
What it is doing here is performing an SQL select statement that grabs those fields and dumps it into a combobox that I have on my form.
I want to be able to make this recordset have a KEY associated with each record in the recordset. That way when the user clicks the item in the combobox I can have a reference to which value I need. There will be some other fields I grab from the Oracle table that will need this key to be associated with this recordset.
Hope someone understands this post. I will be happy to try to help clarify if there are any questions.
Thank you,
-Diran
How would I make it so that I can populate a table I make on the machine that I will have a key (used for ID of each record) associated with each record in the recordset?
Right now I am creating my recordset as follows:
Code:
Dim rsDataSFAF as Object
Set rsDataSFAF = New ADODB.Recordset
strSQL = "SELECT ITEM_NUMBER , DESCRIPTION, TYPE FROM DBTABLE ORDER BY ITEM_NUMBER"
rsDataSFAF.Open UCase$(Trim$(strSQL)), DBConnection, adOpenDynamic, adLockPessimistic
'Move to beginning of the recordset
rsDataSFAF.MoveFirst
'Do while not at end of the recordset
Do While Not rsDataSFAF.EOF
cboPF.AddItem rsDataSFAF!ITEM_NUMBER & " - " & rsDataSFAF!Description
rsDataSFAF.MoveNext ' Move to next record
Loop
rsDataSFAF.Close
DBConnection is already made the connection to the ORacle DB.
What it is doing here is performing an SQL select statement that grabs those fields and dumps it into a combobox that I have on my form.
I want to be able to make this recordset have a KEY associated with each record in the recordset. That way when the user clicks the item in the combobox I can have a reference to which value I need. There will be some other fields I grab from the Oracle table that will need this key to be associated with this recordset.
Hope someone understands this post. I will be happy to try to help clarify if there are any questions.
Thank you,
-Diran