Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 17974
Number of posts: 55343

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to work with an access database? Posted by VB Newbie on 27 Jun 2004 at 1:33 AM
Hi,

I have 2 questions:

1) I have made an access database with data about certain products:
Product-description, Product-id and Product-price.
Now i want to populate a combobox with the product-description data.
When i user selects a product, I want 2 labels showing the corresponding product-id en product-price.
2) I also want the user to alter, delete and add records to the database. Is the DataGrid component best for it?
Report
Re: How to work with an access database? Posted by GideonOmega on 28 Jun 2004 at 5:59 AM
: Hi,
:
: I have 2 questions:
:
: 1) I have made an access database with data about certain products:
: Product-description, Product-id and Product-price.
: Now i want to populate a combobox with the product-description data.
: When i user selects a product, I want 2 labels showing the corresponding product-id en product-price.
: 2) I also want the user to alter, delete and add records to the database. Is the DataGrid component best for it?
:


The data grid will allow you to do this in a visual manner(alter data that is) for the combo box, I would recommend Using ADO Code and a While Not .EOF Loop - if you don't know any ADO Stuff - post back and I'll whip up an example for you - I would now but I have to leave for work.

C:\Dos
C:\Dos Run
Run Dos Run


Report
Re: How to work with an access database? Posted by VB Newbie on 29 Jun 2004 at 11:36 AM
: : Hi,
: :
: : I have 2 questions:
: :
: : 1) I have made an access database with data about certain products:
: : Product-description, Product-id and Product-price.
: : Now i want to populate a combobox with the product-description data.
: : When i user selects a product, I want 2 labels showing the corresponding product-id en product-price.
: : 2) I also want the user to alter, delete and add records to the database. Is the DataGrid component best for it?
: :
:
:
: The data grid will allow you to do this in a visual manner(alter data that is) for the combo box, I would recommend Using ADO Code and a While Not .EOF Loop - if you don't know any ADO Stuff - post back and I'll whip up an example for you - I would now but I have to leave for work.
:
: C:\Dos
: C:\Dos Run
: Run Dos Run
:

:

Thanks for your help Dos,

I just have one more question.
I have decided to make an access db programmaticaly.
I already know how to do that, and already know how a user can specify the path for the access db that my application creates.
Now my question:
I have a DataGrid that i want to display the access db.
Now at design time, i have to specify the path to the access db that the DataGrid must use, but becouse the user specifys the path when the programm makes the access db, i don't know that path!
So is there any way to tell the DataGrid at runtime where to look for the access db?

Thanks

VB Newbie

Report
Re: How to work with an access database? Posted by d3v1lman on 29 Jun 2004 at 2:34 PM
As long as the db stays in the same folder as your app, you could always use the
App.Path & "\filename"

To ERR is human, but to really f**k something up requires a computer...

Report
Re: How to work with an access database? Posted by GideonOmega on 29 Jun 2004 at 10:48 PM
: : : Hi,
: : :
: : : I have 2 questions:
: : :
: : : 1) I have made an access database with data about certain products:
: : : Product-description, Product-id and Product-price.
: : : Now i want to populate a combobox with the product-description data.
: : : When i user selects a product, I want 2 labels showing the corresponding product-id en product-price.
: : : 2) I also want the user to alter, delete and add records to the database. Is the DataGrid component best for it?
: : :
: :
: :
: : The data grid will allow you to do this in a visual manner(alter data that is) for the combo box, I would recommend Using ADO Code and a While Not .EOF Loop - if you don't know any ADO Stuff - post back and I'll whip up an example for you - I would now but I have to leave for work.
: :
: : C:\Dos
: : C:\Dos Run
: : Run Dos Run
: :

: :
:
: Thanks for your help Dos,
:
: I just have one more question.
: I have decided to make an access db programmaticaly.
: I already know how to do that, and already know how a user can specify the path for the access db that my application creates.
: Now my question:
: I have a DataGrid that i want to display the access db.
: Now at design time, i have to specify the path to the access db that the DataGrid must use, but becouse the user specifys the path when the programm makes the access db, i don't know that path!
: So is there any way to tell the DataGrid at runtime where to look for the access db?
:
: Thanks
:
: VB Newbie
:
:


Basicly if you use the open Dialog to allow the user to pick there path to save the db - you can use the dialog contols -- I think it's .filename property and it will return the full path and filename of the db in question - and you could set it in a string variable and concat. it into your datasource path.


C:\Dos
C:\Dos Run
Run Dos Run





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.