add a row to an access database

hugedean

Member
Joined
Oct 25, 2006
Messages
13
Programming Experience
Beginner
Hi,

I have been trying to add a row to an access database using Vb.net for about 3 weeks now and I just can't get it to work.

I am desperate, I have tried multitudes of tutorials on the internet and I have gone through as many forums trying to find out how to do this but to no avail.

Its simple, I have a program where the user types a message into a text field and presses a submit button. The message is then split up into individual words and each word is added as a new row to a table in the database. This program should have taken 15mins to write, but it has been three weeks and I still haven't managed to do it. I am soo frustrated about it and I am desperate for help. Can someone please either describe how to do this (in a simple step by step manner explaining what and why for each step) or even better; write a sample program that shows me how?

Thankyou for your time everyone,

Dean
 
you do have a valid point there. sometimes i think it just comes down to personal preference. some people prefer to not worry about getting messy etc, but some people do. both ways have their advantages and disadvantages. but when you combine doing stuff the "hard" way, with say, something like a dictionary (which you have told me of in another thread), for the most part, the possibility of using and reusing stuff etc goes away (i would think). and by doing it this way you have much much more control over everything.

haha, coding guis.. i must admit that does put into perspective. i remember java... i actually hated coding the gui. you have made some valid points, and it is something to think about.

like i said, for the most part i think it comes down to personal preference... as for me, im off to go add a thousand parameters, line by line :p

have a good one :)

regards
adam
 
like i said, for the most part i think it comes down to personal preference... as for me, im off to go add a thousand parameters, line by line :p

me and my click-drag will have you a race! remember to keep your OO languages well encapsulated now! dont be putting DB access code in a form! :D:D
 
lol, ok this is gonna sound a bit stupid, but can you define 'encapsulated' for me? i hear it a lot and i understand a general meaning of it but i would like clarification from someone that knows... would you be talking about commands within dictionariesm and the sort?

sorry if it sounds dumb but there are some things i just havent really encountered properly yet...

cheers mate

have a good one
 
Sure! Much like in the real world, it's all about putting things in the right boxes. If you had a box for toys, a box for books and a box for food, you'd find it pretty easy to file certain things in them. If you came across a cook book.. hmm - is that food? or a book? what about a blender? food related? Maybe make another box for utensils?

This is how we put stuff in the right places in our programs. Sure, we can have 100 forms, each with 3 buttons, and in the event handling code for each button, we can write some database code:

Dim con as Connection
Dim cmd as Command("SELECT ...", con)


But is a button handler really the right place to be putting it? Probably not. The logic behind forms and buttons etc, should mainly be concerned with taking user input, maybe doing the odd bit of formatting or validation (though heavy validation would have its own classes) and passing it out to another class to work on, do db stuff etc

The way the IDE makes its tableadapters is quite nice and reasonably well encapsulated/boxed up in the right/same place - all the data access logic (should) go in the table adapter and is exposed as a few nice functions for others to call
 
oh ok,... well when you put it like that, ive actually been doing that from the start! haha, learn something new (or not so new :p) every day... i feel better now that its been defined for me... i feel like an idiot every time someone mentioned the word, and i was thinking... "ok adam just smile and nod... everything will be ok".. hahaha. oh well, at least now i know..

cheers for that mate, have a good one

regards
adam
 
Back
Top