how will connect sqlserver 2000/2005 in visual basic 6.0

By tahir khan ·
2 textbox fname and lastname
and and one combobox which will u select city and store in ur sql server.please help me

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

With which bit ?

by Tony Hopkinson In reply to how will connect sqlserve ...

To create a connection instantiate an ADODB.Connection obect set the connection string and open it.

To run a query you instantiate an ADODB.Command object, set it's command text to the required SQl, attach to the connection, call it execute method, and it will return and ADO result set.

To pick up the data you iterate through the result set with, grab the values thought the Fields property and then add them to some form of internal store and then populate teh combo.items, or direct to the combobox Items property.

If none of this makes sense to you, go back to class or start turning up. I mean this is like Very Basic, and someone with your claimed role, a book or google should be able to get their head round the basics in a day.

Related Discussions

Related Forums