How to work with an access database? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to work with an access database?

VB NewbieVB Newbie Posts: 206Member
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?

Comments

  • GideonOmegaGideonOmega Posts: 617Member
    : 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.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • VB NewbieVB Newbie Posts: 206Member
    : : 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.
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :

    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

  • d3v1lmand3v1lman Posts: 66Member
    As long as the db stays in the same folder as your app, you could always use the [code]App.Path & "[italic]filename[/italic]"[/code]
    To ERR is human, but to really f**k something up requires a computer...

  • GideonOmegaGideonOmega Posts: 617Member
    : : : 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.
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    :
    : 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.

    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

Sign In or Register to comment.