homepage Welcome to WebmasterWorld Guest from 54.204.94.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Local / Foo
Forum Library, Charter, Moderators: incrediBILL & lawman

Foo Forum

    
I know this is a webmaster forum but.
I need some help!
Matthew1980




msg:4185511
 7:07 pm on Aug 11, 2010 (gmt 0)

Hi there fellow webmasters!

I have a question; Does anyone know any Visual Basic 6 (VB6), as I have a project that I cannot fathom out the mysql call on - I can retrieve single records but not multiple rows, I have searched for VB6 forums but there are non that I can find that are giving me useful advice.

Anyone have any ideas, as I am stumped. And I'm not used to that ;-p

Cheers,
MRb

 

rocknbil




msg:4185667
 2:39 am on Aug 12, 2010 (gmt 0)

Mysql or access? Being an M$ product, I've only worked with it on access databases, the select statements are slightly different but it's still SQL. You could try the .net area?

john_k




msg:4185957
 1:46 pm on Aug 12, 2010 (gmt 0)

VB6 uses ADO and ODBC to get to any database. The SQL is whatever your database needs to see. Data is returned via recordset objects. If you want to iterate through the rows, use the recordset.movenext method. Another alternative (and faster) is to push all of the results into a 2 dimensional variant array by using recordset.GetRows - then loop through the array. The first index is the column number and the second is the row number. Both indexes will be 0-based.

Bottom line is that you should search for help on the ADODB.RecordSet object.

Matthew1980




msg:4186170
 9:11 pm on Aug 12, 2010 (gmt 0)

Hi there all,

Rocknbil:
Mysql is my flavour of DB - access - ack ;) You can't have multiple users logged into an access db to view records, else the GUI locks, mysql you can, flexible friend :)

John_k:
Thanks for the advice there, that actually makes sense, the sql query functions fine, and only ever returns 1 result (the first record!) I cannot seem to get it to loop, even with movenext.

Thanks guys,

Cheers,
MRb

LifeinAsia




msg:4186191
 10:22 pm on Aug 12, 2010 (gmt 0)

Maybe too obvious, but have you tried executing the actual SQL query through another channel to verify that more than 1 row should be returned?

Matthew1980




msg:4186448
 11:31 am on Aug 13, 2010 (gmt 0)

Hi there LifeInAsia,

Yes, I have mysql query browers running, which is more strict than phpmyadmin, and is easier to get working ;)

Apologies though, at some ungodly hour this morning, I cracked the issue, after extensive reading of the mysql website for the ADO topics, there is an obscure link/paragraph that pointed me to a sollution. With VB6->Mysql you have to instruct the query to 'allow' more than one row to be returned, else the RecordCount/RecordSet object will always return -1, which means that the server hasn't received the instruction to say 'Show all records'. So I amended my object to: ComboQuery.adUseClient before the query was exectued, and now the result returned is correct, all 4 rows are there. Woo!

So thanks for your replies/help, again I know this is a webmaster forum, but I couldn't see the harm of posting.

Cheers from a very chuffed VB6 programmer! (I really had better migrate to .NET now too :))
MRb

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Local / Foo
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved