I have code as follows: - Dim conn As New ADODB.Connection
-
Dim rst As New ADODB.Recordset
-
-
conn.ConnectionString = "Provider=MSDAORA;Password=tr7025ds;User ID=system;Data Source=WIN10"
-
conn.Open
-
-
rst.Open "select sid, serial#, username, program, machine, status from v$session where serial#<>1 order by status", conn
-
-
Do Until rst.EOF
-
For i = 0 To rst.Fields.Count - 1
-
--this is where I need help!
-
Next
-
rst.MoveNext
-
Loop
-
-
rst.Close
-
conn.Close
In the middle of that loop I've had this sort of thing: - Me!Text1 = rst!sid
-
Me!Text3 = rst![serial#]
...and so on.
That works nicely... provided I only want to see one record! It's always the last record, too, because the MoveNext neatly traverses its way through the entire recordset, of course.
What I can't work out is how to display all records on a Continuous Forms basis. I've tried this: - Me!Text1.ControlSource = rst!sid
...but that just makes the control display '#Name?', which made me think the problem was the form is unbound to any record source. So then I tried:
...outside the loop, with the ControlSource setting inside. But that merely produces a 'type mismatch' error. And I also tried setting Me.RecordSET =rst, but that causes an 'Object variable or With block variable not set' error.
I'd appreciate any guidance on this anyone can offer!
It is possible that continuous forms would not be the most appropriate way of displaying this information anyway, so if someone could also explain how to set a list control to display all the records in my recordset, I'd be very grateful!
5 3458
I have code as follows: - Dim conn As New ADODB.Connection
-
Dim rst As New ADODB.Recordset
-
-
conn.ConnectionString = "Provider=MSDAORA;Password=tr7025ds;User ID=system;Data Source=WIN10"
-
conn.Open
-
-
rst.Open "select sid, serial#, username, program, machine, status from v$session where serial#<>1 order by status", conn
-
-
Do Until rst.EOF
-
For i = 0 To rst.Fields.Count - 1
-
--this is where I need help!
-
Next
-
rst.MoveNext
-
Loop
-
-
rst.Close
-
conn.Close
In the middle of that loop I've had this sort of thing: - Me!Text1 = rst!sid
-
Me!Text3 = rst![serial#]
...and so on.
That works nicely... provided I only want to see one record! It's always the last record, too, because the MoveNext neatly traverses its way through the entire recordset, of course.
What I can't work out is how to display all records on a Continuous Forms basis. I've tried this: - Me!Text1.ControlSource = rst!sid
...but that just makes the control display '#Name?', which made me think the problem was the form is unbound to any record source. So then I tried:
...outside the loop, with the ControlSource setting inside. But that merely produces a 'type mismatch' error. And I also tried setting Me.RecordSET =rst, but that causes an 'Object variable or With block variable not set' error.
I'd appreciate any guidance on this anyone can offer!
It is possible that continuous forms would not be the most appropriate way of displaying this information anyway, so if someone could also explain how to set a list control to display all the records in my recordset, I'd be very grateful!
I believe you need to just set the form's recordsource
me.recordsource = rst
Looping through controls will only update the fields in the first record.
And I believe you'll need to add a dynaset option or cursor location. But Oracle isn't my specialty.
J
I have code as follows: - Dim conn As New ADODB.Connection
-
Dim rst As New ADODB.Recordset
-
-
conn.ConnectionString = "Provider=MSDAORA;Password=tr7025ds;User ID=system;Data Source=WIN10"
-
conn.Open
-
-
rst.Open "select sid, serial#, username, program, machine, status from v$session where serial#<>1 order by status", conn
-
-
Do Until rst.EOF
-
For i = 0 To rst.Fields.Count - 1
-
--this is where I need help!
-
Next
-
rst.MoveNext
-
Loop
-
-
rst.Close
-
conn.Close
In the middle of that loop I've had this sort of thing: - Me!Text1 = rst!sid
-
Me!Text3 = rst![serial#]
...and so on.
That works nicely... provided I only want to see one record! It's always the last record, too, because the MoveNext neatly traverses its way through the entire recordset, of course.
What I can't work out is how to display all records on a Continuous Forms basis. I've tried this: - Me!Text1.ControlSource = rst!sid
...but that just makes the control display '#Name?', which made me think the problem was the form is unbound to any record source. So then I tried:
...outside the loop, with the ControlSource setting inside. But that merely produces a 'type mismatch' error. And I also tried setting Me.RecordSET =rst, but that causes an 'Object variable or With block variable not set' error.
I'd appreciate any guidance on this anyone can offer!
It is possible that continuous forms would not be the most appropriate way of displaying this information anyway, so if someone could also explain how to set a list control to display all the records in my recordset, I'd be very grateful!
If you specifically desire continous form viewing have you considered early binding using linked table ODBC using oracle driver?. Controlling your rst by late binding yourself you lose that functionality..File...Get External Data... Linked Tables.
Jim
Jim
I have code as follows: - Dim conn As New ADODB.Connection
-
Dim rst As New ADODB.Recordset
-
-
conn.ConnectionString = "Provider=MSDAORA;Password=tr7025ds;User ID=system;Data Source=WIN10"
-
conn.Open
-
-
rst.Open "select sid, serial#, username, program, machine, status from v$session where serial#<>1 order by status", conn
-
-
Do Until rst.EOF
-
For i = 0 To rst.Fields.Count - 1
-
--this is where I need help!
-
Next
-
rst.MoveNext
-
Loop
-
-
rst.Close
-
conn.Close
In the middle of that loop I've had this sort of thing: - Me!Text1 = rst!sid
-
Me!Text3 = rst![serial#]
...and so on.
That works nicely... provided I only want to see one record! It's always the last record, too, because the MoveNext neatly traverses its way through the entire recordset, of course.
What I can't work out is how to display all records on a Continuous Forms basis. I've tried this: - Me!Text1.ControlSource = rst!sid
...but that just makes the control display '#Name?', which made me think the problem was the form is unbound to any record source. So then I tried:
...outside the loop, with the ControlSource setting inside. But that merely produces a 'type mismatch' error. And I also tried setting Me.RecordSET =rst, but that causes an 'Object variable or With block variable not set' error.
I'd appreciate any guidance on this anyone can offer!
It is possible that continuous forms would not be the most appropriate way of displaying this information anyway, so if someone could also explain how to set a list control to display all the records in my recordset, I'd be very grateful!
- Declare a Global Variable to reference your Open Recordset.
- Open your Form Hidden.
- Set the Form's Recordset Property to the Open Recordset which you created.
- Make the Form Visible.
- When finished with the Form, Close the Recordset and release its Object Variable Reference (Set rst = Nothing).
- I do believe that JConsulting is correct in that your Recordset may be Forward Only/Read Only.
- You may have to set the Cursor Location to adUseClient and the Cursor Type to adOpenKeyset.
- I'm like JConsulting in that I'm not an Oracle expert, so you must experiment should your Form be Read Only.
- You should be able to accomplish what you have requested with the information that I have given you.
- Good Luck.
I believe you need to just set the form's recordsource
me.recordsource = rst
Looping through controls will only update the fields in the first record.
And I believe you'll need to add a dynaset option or cursor location. But Oracle isn't my specialty.
J
Thanks, but I did mention that I'd already tried that and that it produced an error.
- Declare a Global Variable to reference your Open Recordset.
- Open your Form Hidden.
- Set the Form's Recordset Property to the Open Recordset which you created.
- Make the Form Visible.
- When finished with the Form, Close the Recordset and release its Object Variable Reference (Set rst = Nothing).
- I do believe that JConsulting is correct in that your Recordset may be Forward Only/Read Only.
- You may have to set the Cursor Location to adUseClient and the Cursor Type to adOpenKeyset.
- I'm like JConsulting in that I'm not an Oracle expert, so you must experiment should your Form be Read Only.
- You should be able to accomplish what you have requested with the information that I have given you.
- Good Luck.
Phew! Thanks for all that. I frankly didn't understand most of it, I'm afraid. I do Oracle for a living, not VBA!
This is what I came up with and which works quite nicely for my purposes: - Dim db As Database
-
Dim conn As New ADODB.Connection
-
Dim qdf As QueryDef
-
Dim rst As Recordset
-
-
conn.ConnectionString = "Provider=MSDAORA;Password=tr7025ds;User ID=system;Data Source=WIN10"
-
-
Set qdf = CurrentDb.CreateQueryDef("")
-
qdf.Connect = "ODBC;DSN=WIN10;UID=SYSTEM;PWD=tr7025ds"
-
qdf.SQL = "select sid, serial#, username, program, machine, status from v$session where serial#<>1 order by status"
-
qdf.ReturnsRecords = True
-
Set rst = qdf.OpenRecordset
-
-
Me!Sessions.RowSource = ""
-
-
Do Until rst.EOF
-
For i = 0 To rst.Fields.Count - 1
-
Me!Sessions.RowSource = Me!Sessions.RowSource & rst.Fields(i) & ";"
-
Next
-
rst.MoveNext
-
Loop
-
It's probably horrible from a professional perspective, but it gets the job done for a list box (called 'Sessions') that allows me to select the records I'm interested in and then to start drilling down into more detail on other forms.
I appreciate the assistance offered, however.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: aaj |
last post by:
Hi all
I have a small but rather annoying problem with continuos forms, and am
wondering if anyone can suggest a method of getting over it.
The front end is Access 2002 with the BE being SQL...
|
by: Armando |
last post by:
I recently saw the tail end of a "Continuous forms" discussion, but not
enough was available to see if this will be a PITA repeat question. Sorry
if it is.
On a form with its Default View...
|
by: Richard Hollenbeck |
last post by:
I have the following query in my form's code:
Private Function Get_Data(fieldNum As Integer)
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
strSQL = "SELECT & "", "" & ...
|
by: Leo |
last post by:
Hi everybody,
Is there a way to fill a continuous form with an ADO recordset?
Normally when I populate the form with the recordset only the first record
is shown. I want to fill all records....
|
by: MSK |
last post by:
Hi,
I would like to generate a report for a specific record from a
continuous form
Env: MS Access 2003 , ADP project , ADO , SQL server 2000
Workflow:
1. Constructed a recordset using...
|
by: webgirl |
last post by:
Hi there,
I've been searching the net & the forums here over the last few days for help with my problem & am getting myself really confused.. hoping someone may be able to help me here.
I've...
|
by: blueheelers |
last post by:
I have been researching for several hours on the best way to display
images in continous forms in Access 2003. For example, I want to
display employee name, email, phone, and picture for each...
|
by: Greg Strong |
last post by:
Hello All,
Is is possible to use an ADO recordset to populate an unbound continuous
Subform?
I've done some Googling without much luck, so this maybe impossible, but
let me try to explain...
|
by: TurnerTech |
last post by:
Hi guys.
I am struggling with this and I need it to complete a fairly cool facility for the users.
I have a continuous form which is populated by a recordset generated by a "common" routine...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |