-
Dec 21st, 2000, 11:53 AM
#1
Thread Starter
Member
Am I missing something or has my brain taken a early holiday?
Code:
Dim rstCountry As Recordset
Set rstCountry = New Recordset
how can "New Recordset" be bad?
(Invaild use of new?)
I need a vacation.
Jim
"...head is all empty and I don't care..."
-
Dec 21st, 2000, 11:59 AM
#2
Frenzied Member
Try this mate:
Code:
Dim rstCountry As New Recordset
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Dec 21st, 2000, 12:02 PM
#3
Thread Starter
Member
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..."
-
Dec 21st, 2000, 12:02 PM
#4
transcendental analytic
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.
-
Dec 21st, 2000, 12:47 PM
#5
Thread Starter
Member
nope it's Private
Code:
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
Still blows up
Jim
"...head is all empty and I don't care..."
-
Dec 21st, 2000, 12:59 PM
#6
transcendental analytic
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.
-
Dec 21st, 2000, 01:03 PM
#7
If you have multiple libraries then you would have to specify what library you're using:
Code:
Dim rs As New ADODB.Recordset
-
Dec 21st, 2000, 01:22 PM
#8
Thread Starter
Member
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..."
-
Dec 21st, 2000, 02:41 PM
#9
Lively Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|