Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 2nd, 2005, 04:28 PM
Registered User
 
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to boneill Send a message via MSN to boneill
Default VB.net Database -> user defined object

I'm able to connect to a database and put information into a dataset object. How can I take information from the database and put it into a string for example.

so, to explain better, Let's say I have a table of people in the database and in my vb program I defined a class called people. I want to create a collection of people to use in my program, I want to create people objects and fill their first and last name properties from what is in the database.

am I going about this the wrong way? Let me know! thanks.:D

-Brian O'Neill
 
Old May 2nd, 2005, 04:43 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

It depends on the broad overview of what you are trying to accomplish.
Could you expand on your question?
 
Old May 2nd, 2005, 04:56 PM
Registered User
 
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to boneill Send a message via MSN to boneill
Default

yeah, Im sorry im new to this and im having trouble explaining.

I have a database built with access. I can make an OLeDBconnection to the database.

I want to get data out of a table (example: names of people in a table of people) and save it as a string.

-Brian O'Neill
 
Old May 2nd, 2005, 05:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

open a recordset like
"select people from table_of_people"
then loop through it:

.movefirst
dim result as string
do
if .eof the exit do
result = result + " " + .field("people").value
.movenext
loop

Marco
 
Old May 2nd, 2005, 05:23 PM
Registered User
 
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to boneill Send a message via MSN to boneill
Default

Thanks!

-Brian O'Neill





Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection user-defined type not defined Wall st Guru Excel VBA 2 March 26th, 2014 03:44 PM
Appl-defined or Object-defined error 1004 chp Excel VBA 3 April 4th, 2006 08:12 AM
User-defined type not defined (Icecream.mdb) dloren01 BOOK: Beginning Access VBA 0 June 22nd, 2005 10:36 PM
VB.Net -> Filename -> DTS Package -> tempdB daniel Pro VB.NET 2002/2003 1 October 7th, 2004 01:46 PM
Passing user defined parameters to vb dll Smita VB How-To 0 March 29th, 2004 04:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.