473,625 Members | 2,677 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving/loading a structured array from an Access database

This may reveal my poor programming skills, but here goes...

I'm building a pricing tool for my business. I'm nearing the end of the
project, and I've been asked to be able to save quotes in some sort of
database (Major Feature Creep). For each quote, I've got two kinds of
variables. The first are global for the quote, such as

numQuoteRows
QuoteFinalCost
CustomerID

Secondly, I've got the quote rows stored in a structured array, for example:

quoteRow(3).wid getHeight is the height of quote row 3 widget.
quoteRow(6).wid getQuantity is the number of widgets in quote row 6

The question is, how can load & save this info into an Access database. I
figure I can have one table with the global quote information, and one with
the quote rows, but I'm not sure how to feed the info to & from the database.

Please bear in mind I first picked up an intro to VB.NET book a little over
a year ago, and this is my first massive programming project. I've got Access
databases for customer info and all the widget pricing & configuration, so
descriptions of an Access interface would hopefully work. Many thanks for any
advice that you can provide.

--
Cary
Nov 21 '05 #1
2 1993
Cary,

The first thing you should do in my opinion is make from your array a
datatable.

Than it is so very simple doing what you ask.

In the most simple approach do you need than

An oledbconnection
dim conn as new oledb.oledbconn ection(myconnec tionstring)

For you connectionstrin g
http://www.connectionstrings.com/

a datatable
dim dt as new datatable

a dataadapter
dim da as new oledbdataadapte r("Select * from mytable",conn)
da.fill(datatab le)

an oledbcommandbui lder
dim cmb as new oledb.oledbcomm andbuilder(da)
'this one builds the command and probably you never use it further however
with this the commands are build (when your selectstrings becomes complex
you cannot use it anymore however with your 2 fields it is probably great).

And when you have done your changes you do
da.update(datat able)

And then when you have no concurrent users and set all the error trapping
needed using try and catch, you are almost ready

I hope this helps?

Cor

"Cary" <Ca**@discussio ns.microsoft.co m>
This may reveal my poor programming skills, but here goes...

I'm building a pricing tool for my business. I'm nearing the end of the
project, and I've been asked to be able to save quotes in some sort of
database (Major Feature Creep). For each quote, I've got two kinds of
variables. The first are global for the quote, such as

numQuoteRows
QuoteFinalCost
CustomerID

Secondly, I've got the quote rows stored in a structured array, for
example:

quoteRow(3).wid getHeight is the height of quote row 3 widget.
quoteRow(6).wid getQuantity is the number of widgets in quote row 6

The question is, how can load & save this info into an Access database. I
figure I can have one table with the global quote information, and one
with
the quote rows, but I'm not sure how to feed the info to & from the
database.

Please bear in mind I first picked up an intro to VB.NET book a little
over
a year ago, and this is my first massive programming project. I've got
Access
databases for customer info and all the widget pricing & configuration, so
descriptions of an Access interface would hopefully work. Many thanks for
any
advice that you can provide.

--
Cary

Nov 21 '05 #2


"Cary" <Ca**@discussio ns.microsoft.co m> wrote in message
news:5A******** *************** ***********@mic rosoft.com...
This may reveal my poor programming skills, but here goes...

I'm building a pricing tool for my business. I'm nearing the end of the
project, and I've been asked to be able to save quotes in some sort of
database (Major Feature Creep). For each quote, I've got two kinds of
variables. The first are global for the quote, such as

numQuoteRows
QuoteFinalCost
CustomerID

Secondly, I've got the quote rows stored in a structured array, for
example:

quoteRow(3).wid getHeight is the height of quote row 3 widget.
quoteRow(6).wid getQuantity is the number of widgets in quote row 6

The question is, how can load & save this info into an Access database. I
figure I can have one table with the global quote information, and one
with
the quote rows, but I'm not sure how to feed the info to & from the
database.

Please bear in mind I first picked up an intro to VB.NET book a little
over
a year ago, and this is my first massive programming project. I've got
Access
databases for customer info and all the widget pricing & configuration, so
descriptions of an Access interface would hopefully work. Many thanks for
any
advice that you can provide.

--
Cary


Taking this from the very top...
As I understand it.

You have a 1 to many relationship between quote and rows.
So you want 2 tables

Quotes
Quote_Rows

You need to identify what Rows go with a quote, so you need the key to
Quotes as a field in Quote_Rows.
You can then do a join between them with your sql/query.

Quotes
Quote_Id ( Set as primary key )
whatever other fields

Quote_Rows
Quote_Row_Id ( As primary key )
Quote_Id
description
height
width
quantity
whatever other fields

Go into the relationships thing, add both tables and define the relationship
between the two.

I would suggest if you've done any access work then maybe you should stick
to that.

In access.
The simplest way is a subform for the rows in a form for the quotes.
You do that by designing a form for rows, set it to continuous form as
default view.
Stick all the data on one line in the detail section and size everything
else down if you can.
Make the form header and footer visible.
Put any totals fields in the footer as calculated fields, setting the
source to =sum(quote_row_ whatever).
Stick field headings in the header.

Design your Quote screen.
Stick your fields on and get it looking OK ex the rows.
Set it to single form default view.
Then, drag and drop the row screen onto the quote screen.
It'll sort of automagically create the links between them.

--
Regards,
Andy O'Neill
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9475
by: C | last post by:
Re: Microsoft Knowledge Base Article - 870669 How to disable the ADODB.Stream object from Internet Explorer You may recently have heard of the vulnarability exposed by Internet Explorer as described in that article: "An ADO stream object contains methods for reading and writing binary files and text files. When an ADO stream object is combined with known security vulnerabilities in Internet Explorer, a Web site could execute scripts...
1
6477
by: Inon Zukerman | last post by:
hello everyone. My problem is as follows : my application keeps a hashtable with Outlook.MailItem objects. I need to save and load this hashtable (with those objects inside) when starting and terminating the application. I can't "serialize" them because Outlook.MailItem objects do not implement
4
6718
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my code ?? thank you Pedro Leite From Portugal ------------------------------------
6
8111
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a picture of themselves to their profile... I admit that I'm a newbie... but this is how I understand this:
6
6440
by: Mark Denardo | last post by:
My question is similar to one someone posted a few months back, but I don't see any replies. Basically I want to be able to have users upload photos and save them in a database (as byte data) and be able to load them to an image webcontrol, but system.web.ui.webcontrols.image only seems to have a control to load the image from a URL. There's no way to load this directly without saving the image as a file and then using...
14
2052
by: Simon | last post by:
I'm trying to write a little function to save data. Basically I have a large 2d array of structs, so I'm going to have to call the save function once per struct in the array. I'd like to save the data using fwrite(). After quite a lot of effort I've come up with the code below, but I'm having real difficulty getting rid of the last error. When compiling, I get this: Line 52: "warning: assignment makes pointer from integer without a...
3
1763
by: Nathan Guill | last post by:
I have an interface that works with an Access back-end. I would like to store and/or load user defined query strings per each user (i.e. no user can access another's queries). The idea I had was a "table" stored with the C# front-end (not in the Access database), but don't know if this is even possible. If it is, can someone let me know how? Otherwise, how do other people handle storing and loading query strings for possible later use?
12
2064
by: einsanic | last post by:
Dear everyone, I am new to this forum and I am realitevely new to C programming so please forgive me for any basic mistakes I'll be making. I am trying to dynamically allocate the space for the global structured array of pointers that is available to all functions in my program. Since C doesn't allow open array arguments in funciton calls and I do not know the size of the array at compile time I am not sure how to pass this array to the...
0
2025
by: ne0lithic | last post by:
Hey everyone, I'm working on a program based on steganography. For this, i need to access the individual pixels and perform my manipulations. FYI, I do not have the JAI library available with me and I have to make do with awt, imageIO and image. I'm having no issues in loading an image but when i thought I would test things and just save the same image without manipulation I was surprised. After copying the pixels from the image into an int...
0
8253
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6116
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4192
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1499
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.