Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 November 21st, 2006, 11:31 AM
Registered User
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to FrancisEnem
Default New to VB/Database (Urgent)

I Just started VB/Database programming not more than a week ago. I need a whole lot to make my life easier.

1. I have a form with text fields. I have created a dataset and a data adapter. My problems are
i. how to populate the text fields with the data from the dataset
ii. how to navigate to the next/previous record
iii. how to save/delete records from the dataset
iv. to to navigate yo the first/last records

2.In my application, I have created a menu for several forms; my control(buttons) resides on the menu which is the child MDI. Suppose I have a control (Save) in the Main MDI form, I want to use this control to save a record in a child form within the main MDI form. In order words, I want to know
i. how to pass parameters from Main MDI to child forms
ii. how to write independent procedures and functions(classes) and call them from any of my form within the Main MDI form.

Regards

 
Old November 24th, 2006, 03:36 PM
Authorized User
 
Join Date: Aug 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anubisascends
Default

For answers to all of this, I would take a look at the MSDN library to find the answers, or get one of the wrox books, both of these resources really helped me.

I am still not too familiar with passing DB info to a VB app yet, but I can tell you that your IDE can take care of alot of this. Try using the help files located in the IDE that you are using.

to pass info from the MDI to the Child, you can try creating a public variable, or create a custom property.

public variable:

Public test as string = textbox1.text

property test() as string
get
textbox1.text
end get
set (byval value as string)
textbox1.text
end set
end property

hope this helps a little.

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein
US (German-born) physicist (1879 - 1955)
 
Old December 11th, 2006, 03:04 PM
Registered User
 
Join Date: Dec 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To call functions and procs described in a different form or module, you can make them public and your application will find them. You can also qualify them ie: mod1.get_name(xxx)

I am out of date here, but I have used those techniques in the past.

Simple answer to your simplest question...

 
Old December 11th, 2006, 03:11 PM
Registered User
 
Join Date: Dec 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, since I am still waiting for a solution to my problem, and in the meantime am waiting for vb.net to load...

1. I have a form with text fields. I have created a dataset and a data adapter. My problems are
i. how to populate the text fields with the data from the dataset
> there are a few different techniques for this...and it depends on which version of VB, but in general, they are the similar. You can either link them to your dataset field values, or you can move the data in manually (ie: a call to a load_data subroutine). The first method is simpler, if these are indeed database-related values. If not, you MUST use the 2nd technique.
ii. how to navigate to the next/previous record
your dataset should have functions like "movenext" or "moveprevious"
iii. how to save/delete records from the dataset
I usually use SQL for all my data manipulations, so I create either a database proc to do this -- like an API -- and do some checking at that level -- or you could create a sql statement and execute it directly within your VB code.
iv. to to navigate yo the first/last records
your dataset should have movefirst, movelast OR use SQL to do this...

Hope this helps some.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent: Excel and Vb 6.0 ivanlaw Pro VB 6 5 October 22nd, 2007 03:34 AM
Urgent:VB coding ivanlaw Pro VB Databases 9 September 7th, 2007 07:06 AM
Urgent :VB ivanlaw Pro VB Databases 19 August 31st, 2007 08:09 PM
Urgent :VB 6 and Database ivanlaw Pro VB Databases 10 August 23rd, 2007 07:35 AM
urgent (in vb.net) renjininair_2000 BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 12 March 31st, 2006 11:56 AM





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