Visual Studio Development Bookmark and Share   
 index > Visual Basic Express Edition > Setting up a local database program and getting lost.
 

Setting up a local database program and getting lost.

I am trying to learn Visual basic 2008, as I create a product lister program, that only has to go out to a text file that will then be uploaded to an auction site, as a bulk upload. It is basically just an offline editor with a few things to make life easier and autofil some of the options, as ther eis none available for the site.

However I am getting a little lost on the basics of setting out the database.

It has to have the stored listed items table and forms
But then it also has to have a listing form ( for items that are being produced so as not to get them lost in the mass of items already listed and stored.
I was also thinking of a quick list, which would contain partial information, for things that are repetitive, such as postage methods and payment methods, that would be added to listing form on request, of which is chosen.

Now I am trying to work out how best to lay that out in a local database, such as, would it be possible to add a temp column to the Listed Table, which the data added such as an increment or date, would then be deleted when "add to Listed" is selected by me the user. So that the information was used up to the point it was listed, and then that columns data would start again when the next lot of listings were created?

It has to be sent out to a text file, like tab delimited, and I was just wondering if it was possible to merge two or more columns into one on the output text file.

I am also wondering is there a way round the max 4000 characters per entry, when using VB2008? as one of entries for one of the columns will be a WYSIWYG and code editor, which can have quite a few more if I decide to use templates and other standards?

The basic data bellow I have just coppied from my blog, so ignore some of the coments, as they are just thinking out allowed but the list should give you an idea of what I am working on.

Username ( I want this to be auto added from the sign in)
Category id (This I have created a seperate table that will be added to on a seperat form as I will only use some of them and then try and make it a dropdown of the table.)
eBid Store Category (Doing the same as above This I have created a seperate table as I will only use some of them and then try and make it a dropdown of the table.)
LEAVE EMPTY (Needs to be left empty)
Auction Title (Only has 55 characters)
Image URL ( was thinking of setting up a loader then make it add together on the output table, as it has to be located online)
Item Condition (Drop down with three options)
Quantity ( 1 to 25)
Start ( Three options one of which can be a date and time)
End (Three to ten days)
Starting Bid (Money)
Sales Tax (Money but needs to be left with 0.00, as it does not count in the UK)
Reserve (0.00 as pre fill but as I do not use it much)
Feature (drop down list with three options)
Minimum Feedback to Bid (standard zero)
BuyNow price (money)
Minimum Feedback to BuyNow (only to be used if above is used but would still need the space filled)
Domestic Shipping (Need a tick list that will be converted to a code)
International Shipping (as above)
Payment Methods (As above but have a tick list, as more than one can be selected)
Auto Repost (1 to 10 pre filled at 10)
SKU (Never use it)
description (Problem is the max I can get from the VB database is 4000 and the max I can get from the ebid listing is 37000. So have to work that one out. Would also like to make it a WYSWYG HTML editor.)
Then there is the close, as with most text conversions is required, which has to be pre Filled with
##end##

Thanks for any help in advance, I am just starting out with this and drawing on all the howto helpfiles and trying to look through downloadbale code to see how others have done things, and I have not even got into learning the langauge yet, although I must say I am learning bits and pieces.

Thanks

Martin
meknownowt  Sunday, October 18, 2009 5:27 PM

to get out data from your table you need to do it:

The best way to it is:


Using con As New OleDbConnection(cnn)

Dim name As New OleDbCommand("Select * From Table1 ODER BY ID", con)
con.Open()
Dim reader As OleDbDataReader = name.ExecuteReader()

With reader

If .HasRows Then

.Read()

Dim InterSql As Integer = .FieldCount

Dim codigotorneo as String= .Item("Torneo").ToString Then

End If

End With


Don't judge me, just Upgrade me. Thanks!
Malange  Sunday, October 18, 2009 7:53 PM
I have not even got into learning the langauge yet
You really ought to learn the language first before even thinking about database programming.
Dave299  Sunday, October 18, 2009 9:37 PM
Martin,

try asking one question at a time. start simple with one item at a time. you can start a new thread for each single question you have.
FREE DEVELOPER TOOLS, CODE & PROJECTS at www.srsoft.us Database Code Generator and Tutorial
Jeff - www.SRSoft.us  Monday, October 19, 2009 1:23 AM
Malange

Thanks for that, still not up to that level yet, but I have all answers stored for when I get to the problem.

Dave299

Thanks for the advice, but I have tried that method with other languages, and tend to get bored and give up, as I forget what I have read for when I need it. I try to work through a project, a problem at a time.
I tend to get further this way, as the problems I face tend to stick in my old brain a lot longer, than if I read the same thing in a book or web page.
I suppose my brain needs something to relate info to, if that makes sense.

Also I am making use of the how to videos, and they start with the database, which I can then move onto the forms I need, then start looking at each problem, probably starting at one, like the sign in, then the next.

Jeff - www.SRSoft.us MVP

Yeah probably did go over board, sorry about that.

So I suppose the main question is on the layout of the database, and if I am on the right path, by adding what would be a column, to hold temp data, and a second permanent column for the Quicklist or would I be better creating a new table for each of the elements that are identical, such as
Listed (already listed, uploaded, and stored until delete)
Listing (the items I would be working on, saved until bulk uploaded and added to Listed,) (The temp data would then be removed in that column)
Quicklist (That would only need selected columns from Listed, to be added into a listing form.)

It just seems a lot of data being stored if I choose to do it with three tables, but there may be a reason I have to, as the method I am thinking of will just cause problems? I am just hoping you fine people can advise.

I hope this makes sense

Thanks again for any help offered, and sorry for the first mass of questions.

meknownowt  Monday, October 19, 2009 11:23 PM
Martin,

i briefly read over what you want and i think the best thing i can tell you to start is to think about the number of tables as ways to eliminate repetitive data.

for example, say you need to store customer, order and payment information. you can have one table to store all of this but you will have a lot of repetitive data because for each order you need to have the customer information which can include many columns of data including address, phone, etc... you break this up by having the customer info in one table. and you can go further if the customer may have multiple addressses you need to store. you could have a table just for the address information. and so all of the data is tied to by an id to keep the related data. instead of storing all the information over and over, you just store a single id which can be used to retrieve the related data from each table.

i don't know how you need to handle everything but something that may be close to what you need is the payment methods. say you have3 methods right now (cash, check and credit card). you could have a column for each of these in any table you choose and you can check off whichever one you want. but this will keep you stuck with just those three methods. and the only way to increase the methods would be to add more columns. so the way around this is to have a table just for the methods. this will give you the ability to add or remove methods as needed. when you load up your form you retrieve all the records from the methods table to show in a combobox or whatever control you want. when a method is made you can either store the method itself or an id for that method. but you need to consider whether or not you would delete a method. if you use the id but you end up deleting that method then it will be lost because the id won't mean anything.

well i hope this has helped with some of your questions. it is late and i need to get some rest. let me know if you have any more questions about what i said. or you may already understand this and i am not fully following what you are asking. tomorrow i will have a fresh perspecitve.
FREE DEVELOPER TOOLS, CODE & PROJECTS at www.srsoft.us Database Code Generator and Tutorial
Jeff - www.SRSoft.us  23 hours 41 minutes ago
Hi,

Well when i started programming i use to do simple programs at first for example adding two numbers, fooling around with strings and stuff. Once i did that i started using arrays to store data. then i came to connecting with the database (mostly sql). once you are able to do that you r somewhat okay in programming.

Take it from simple to difficult and be set on one language only. if C# then stay on c#. Master C# first and then think of learning others or else u will be in a mess of keywords issue.

As for database connection, read the malanges post i think his answer is correct

HG
HammerGuy  16 hours 16 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• Access Databases, Queries and Reports in VB 2005
• printing RTF text
• How to change the focus to another control
• Key Management?
• Objects Flash During Visibility Change
• Great example code projects here!
• combo box help
• Strings in different subs
• Addressing fields on another form (Repost)
• Adding a ".dll"