|
-
Aug 30th, 2000, 09:13 AM
#1
(1) Can you guys check out this thread and try to answer it?
http://forums.vb-world.net/showthrea...threadid=28698
(2) I know what DAO is and how to use it, but can anyone explain to me what ADO is and how to use it?
I posted the first wuestion in the Database section, but didn't get a lot of response.
Thanks!
-
Aug 30th, 2000, 09:15 AM
#2
Frenzied Member
here you go
SQL = "SELECT * FROM MyTable WHERE ID =2"
if ID is a text field
you go
SQL = "SELECT * FROM MyTable WHERE ID = '2'"
sql is almost identical accross all platforms, applications..
second part:
ADO is way of accessing db, DAO is too
but MS wants you to use ADO from now on
ado is faster, and its better because there is more support for it)
there is a lot of threads explaining their differences..
-
Aug 30th, 2000, 09:37 AM
#3
kovan: It still returns only the first record with the specified ID 
Any ideas?
-
Aug 30th, 2000, 09:39 AM
#4
kovan: what references/components should I use for ADO? and what's the latest version?
-
Aug 30th, 2000, 09:52 AM
#5
Fanatic Member
If you are running VB6 with Service Pack 4, you should have ADO 2.5.
The reference is "Microsoft ActiveX Data Objects 2.5 Library".
-
Aug 30th, 2000, 09:53 AM
#6
Hyperactive Member
Sc0rp - How have you checked that only one record is coming back ? The SQL looks fine that everyone has provided. Try this and let us know the answer :
Code:
rsTemp.MoveLast
MsgBox rsTemp.Recordcount
If it returns 1 then check you're not running the SQL against a query which uses SELECT DISTINCT * FROM table because that may be filtering out the duplicate rows before your SQL is run against it.
That's Mr Mullet to you, you mulletless wonder.
-
Aug 30th, 2000, 10:08 AM
#7
Oh.
I didn't use the MoveLast method.
Why do I have to do that?
If I load a database using OpenDatabase the recordcount property returns the right value, even after MoveFirst, or MoveNext.
-
Aug 30th, 2000, 10:17 AM
#8
Frenzied Member
use the sql i gave
and do the following
Code:
while not rs.eof
listbox1.additem !Name
rs.moveNext
wend
that will put all the names that sql returns
you weren't looping
you have to loop to get all
[Edited by kovan on 08-30-2000 at 12:33 PM]
-
Aug 30th, 2000, 11:17 AM
#9
Frenzied Member
Kovan, you'll need a movenext in your while statement or it'll become an infinite loop...
-
Aug 30th, 2000, 11:33 AM
#10
Frenzied Member
stupid me
hehe
ya,
ther is one now
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
|