Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 looking for help to load from SQL server

Status
Not open for further replies.

vbmorton

Technical User
Dec 27, 2004
44
US
Need help,
new to vb, trying to find the code that will allow me to get info from SQL Server on start up, trying to populate a few fields in a small table to allow user to add,delete,update.

pfernandez@mortonmetalcraft.com
 
NO, have the connection string, already connect to the sql server, but was looking for what you do after the connect, to load the grid. But have since fiddled my way thru that. If i can ask a similar question, is it best to keep the laod grid in a class module or in the form itself as a part of the load.?
 
There isn't really a best way to do this. In general, however, class modules are good to use when you have code that you're going to reuse in numerous places. Of course, so are procedures.

If you're going to reuse code in different projects, it makes sense to put the code in a class and expose its functionality through methods and properties. If your reused code is limited to the single project, you might want to use classes if you want to reserve the option of making the code reusable through multiple projects. If not, just use procedures.

As an example, I have a dbUtils class that sets up some connection strings, does some standard formatting, handles updates, deletes, and inserts, and so on. I have used it in several different projects.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top