Results 1 to 10 of 10

Thread: Creating database from code

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Location
    canada
    Posts
    10

    Question Creating database from code

    Hi everyone, this will be my first post here.
    I'm a relatively new programmer, I've been teaching myself as I go for the past few months while I tackle my own project, learning with the assistance and guide of various books and forums like this 1.
    My question is...
    I'm using an Adodc database, and trying to re-create it from code so that I can make my table larger (Access has a limit on the number of fields)
    Can anyone tell me how to do this?
    ~ Hardest working newbie on the net ~

  2. #2
    Lively Member twistedthoughts's Avatar
    Join Date
    Oct 2002
    Location
    dxb
    Posts
    114
    I guess ADODC is the name of the ADO Data Control and not a database.

    Anyway, you can use ADOX to create database & tables using code.


    Try this link or do a search on the forum
    Opinions Are Like Belly Buttons, Everyone Has One!

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Creating database from code

    Originally posted by Kracked
    and trying to re-create it from code so that I can make my table larger (Access has a limit on the number of fields)

    Again, explain this. You mentioned this in another thread.

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Location
    canada
    Posts
    10
    Maybe i'm not explaining things right.
    Adodc is the control, i'm using microsoft access for the database(Jet 3.71 or something like that)
    But yeah, it'll only let me use a certain number of fields per table, isnt there another way to get around that?
    I have 15 columns all 20 rows deep. (All the items in the columns are indexed like Startnumber(1) Startnumber(2))
    I tried to have 1 field for each of the 300 text boxes in 1 table thru 1 Adodc control, but it wouldnt let me, I can make 20 tables.....but dont know how to have them all be accessed from the form without using 20 Adodc controls.
    Thats why I want to use the code, so I dont need the controls
    I hope that makes sense, I tend to think and talk at the same time so things sometimes come out sounding funny to everyone but me lol
    Plus I'm not very familiar with the terminology yet.....but it's getting better
    ~ Hardest working newbie on the net ~

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by Kracked
    Adodc is the control, i'm using microsoft access for the database(Jet 3.71 or something like that)
    So far, so good.

    But yeah, it'll only let me use a certain number of fields per table, isnt there another way to get around that?
    Access does not place a limit on the number of fields per table. I have open in front of me, right now, a table with 22 fields.


    I have 15 columns all 20 rows deep. (All the items in the columns are indexed like Startnumber(1) Startnumber(2))
    I tried to have 1 field for each of the 300 text boxes in 1 table thru 1 Adodc control, but it wouldnt let me, I can make 20 tables.....but dont know how to have them all be accessed from the form without using 20 Adodc controls.
    Thats why I want to use the code, so I dont need the controls
    I hope that makes sense, I tend to think and talk at the same time so things sometimes come out sounding funny to everyone but me lol
    I think we're losing out in between due to terminology here. I'm getting confused where you say "300 textboxes in 1 table", because there are no textboxes in a table. If I assume them to be fields, I find it contradicting with your "it won't let me" statement....

    Perhaps someone will understand this better, but if you're feeling a little active today, do me a favor.

    Make a snapshot of your form, and your access table. Then label exactly, what is what... the textoboxes, the fields, etc. So I know what you're referring to.

    I know the answer is pretty simple in this case, but the words are confusing me.

  6. #6

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Location
    canada
    Posts
    10

    Pictures

    Ok, I took a couple screenshots for u to look st and put them on a geocities page I whipped together.
    (sorry for the delayed response btw, i just bought a new computer tower and was setting it all up)
    heres the link
    http://www.geocities.com/kracked/
    The top picture is what my form looks like.
    Thats what I meant by 300 textboxes on 1 table, i meant the table I drew, not the access databse table (there i go making things sound confusing again - i tend to do that lol)
    The fields are pretty obvious what they are referring to on the form.
    the name of the field refers to obviously what it says, and the number at the end of the field name refers to what pen it is(row on the form)
    There are 20 pens, so for example in my fields you see Pen1, Code1, StartNumber1, there are also Pen1, Pen3 up to Pen20 for field names.
    ~ Hardest working newbie on the net ~

  7. #7
    Banned
    Join Date
    Jul 2003
    Location
    New delhi
    Posts
    143
    if you wan to create a database from the code in sql srvere

    then take the use of SQL DMO


    it give you all the paraamter like ssrvere database table


    to cratea and manipulate a datbase with all his proprties

  8. #8
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    You can use SQL in code to create a database, tables, fields, etc. There's probably examples in the forums if you search, or get a good SQL book (good idea anyway).
    From Microsoft Access Specifications in Help (for Access 2000):

    Number of fields in a table 255

    Of course, it also says you can have 2048 open tables, but I wouldn't try that!

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    1. Aah, I see what you're doing. You've effectively used textboxes to create a grid! Are you aware of the MSFlexGrid, by the way? You can effectively use it to display all the data you need, without having to worry about the limit reached by the textboxes. Plus, it's pretty flexible too. From what I see, all that you've done there can be accomplished on a flexgrid.

    If you're going to go by this many textboxes, instead of using the better MSFlexGrid resolution I just reccommended (what you've been calling fields), then you'll be limited to 255. Unless you create a textbox array.



    2. Have you considered using Access for working with your database and tables instead of the VB add in?

  10. #10

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Location
    canada
    Posts
    10

    Blah

    Yeah your right.....
    I've heard a lot of people tell me I should be using MSFlexGrid.
    I've been avoiding it because, well, for 1 thing it means starting over, and I hate having to start from square 1, I've put a lot of work into this and was kinda being stubborn about finishing it the way that I had started , but it would make things simpler in the long run I suppose when i go to expand the number of pens.....
    The user has to be able to type into the grid boxes tho, and enter in their own data and have it saved in the databank, and I have to be able to program various formulas into all of the gridboxes.
    I dont know the first thing about MSFlexgrid tho, like i said before I'm starting out on my own with no help from anything except for the forums, you know basically what I'm trying to accomplish, can you get me started in the right direction with MSFlex?
    ~ Hardest working newbie on the net ~

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width