Am I missing something or has my brain taken a early holiday?
how can "New Recordset" be bad?Code:Dim rstCountry As Recordset Set rstCountry = New Recordset
(Invaild use of new?)
I need a vacation.
Am I missing something or has my brain taken a early holiday?
how can "New Recordset" be bad?Code:Dim rstCountry As Recordset Set rstCountry = New Recordset
(Invaild use of new?)
I need a vacation.
Jim
"...head is all empty and I don't care..."
Try this mate:
Code:Dim rstCountry As New Recordset
I tried that too. Didn't work before. I think that I may have some setting wrong or something.
Jim
"...head is all empty and I don't care..."
Recordset is probably public not creatable
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
nope it's Private
Still blows upCode:Private Sub FillCountryCombo() Dim rstCountry As New Recordset 'Dim rstCountry As Recordset 'Set rstCountry = New Recordset rstCountry.Open "SELECT DISTINCT Customers.Country FROM Customers ORDER BY Customers.Country", m_conn, adOpenForwardOnly, adLockReadOnly cboCountry.Clear cboCountry.AddItem "" Do Until rstCountry.EOF If Not IsNull(rstCountry![Country]) Then cboCountry.AddItem rstCountry![Country] rstCountry.MoveNext Loop End Sub
Jim
"...head is all empty and I don't care..."
Hmm, now i don't get it.Are you the designer of Recordset (sounds like database stuff and i don't know much about them). Because a private class wouldn't be available outside it's project..
Or do you mean the object is private? Sorry for not being a db expert :/ or whatever
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
If you have multiple libraries then you would have to specify what library you're using:
Code:Dim rs As New ADODB.Recordset
Thank you both for the help. I forgot "ADODB." in front of th word recordset (Thanks Serge). Can you tell me the difference, so I don't do that again (If you have the time)?
Thank you everyone and happy holidays!
Jim
"...head is all empty and I don't care..."
I think he means there are multiple libraries referenced in your project that have something defined as a 'Recordset'
you can see your project references in the program menu, Project | References
Since they are both loaded, you have to qualify which library the recordset you want to use belongs to.
Dim rs as new ADODB.recordset explicitly tells VB which definition of recordset to use.
Your error sounds like VB was trying to use the other definition of recordset which was not an object that can be instantiated via the new operator