Results 1 to 19 of 19

Thread: Database Help!

  1. #1

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217

    Database Help!

    What where in the database tutorial is how to use SQL Commands? and how wouls I be able to add to a database without haveing to use textboxes?
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  2. #2
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    1) Umm which one? The one on this site by Karl? If so dunno!

    2) Do it exactly the same way you would with a text box.
    But instead of a text box put a list box or a combo box or whatever!

    i.e Set the datasource and datafield properties of what ever you using!

  3. #3

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    yea, karls, and I mean how would I be able to add info into a database using varibles, no controls.
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  4. #4

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    I really need help on this, please!
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  5. #5
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    ohhh ok sorry!

    2 things post in Database forum coz thats were the db experts are!

    from a variable!

    I'm not at a VB enabled computer but with data controls which you shouldnt be using anyways! you could do something like

    After declaring db as databse and rs as recordset etc.

    dim field1 as string

    field1 = rs.field "name of field here"

    Try that i hope it helps!

  6. #6

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    I usually post here because usually nobody goes to the other forums
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  7. #7
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    yep does take a bit longer there but i'm usually checking them, chrisjk, jethro and a few others are usually checking them.

    How'd it go!

    Oh Yeah! The Devil Has Arisen.
    my old post count was 666

  8. #8

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    can you explain what you just told me a little better?
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  9. #9
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    yep sorry bieng vague maybe!

    Dont Use datacontrols but for the sake of easyness i'll let you get away with it!

    Dim db as database ' I'm sure you've seen this in Karls tutorial.
    dim rs as recordset ' ditto.

    Set db.connect = "database path" 'these 2 bits maybe a bit wrong as i cant test them.
    set rs = db.recordsource "table name here" ' setting the recordsource to your db

    dim field1 as string ' making field1 a string

    field1 = rs.field "name of field here" 'setting field1's value as whatever is in rs.field "blah blah" so now field1 contains the values of whats in rs.field "blah".

    Hows that?

  10. #10

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    for all of this do I have to be using Access dbs? because I am useing Database III or IV, I am getting some errors with the code you gave me, I cant figure it out
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  11. #11
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    ohh yep Access i ddint know you were using dbase!
    I dont know much about dbase sorry!

    What are the errors?

  12. #12

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    heres the come I am using now:
    Dim db As Database 'I'm sure you've seen this in Karls tutorial.
    Dim rs As Recordset 'ditto.
    Set db.Connect = "dBASE III;C:\Program Files\Microsoft Visual Studio\VB98\fwnmcnSERVER" 'these 2 bits maybe a bit wrong as i cant test them.
    Set rs = db.RecordSource("users2") 'setting the recordsource to your db

    Dim field1 As String ' making field1 a string

    field1 = rs.field "name of field here" 'setting field1's value as whatever is in rs.field "blah blah" so now field1 contains the values of whats in rs.field "blah".

    I changed some things because I dont know what I am doing. ok on the db.connect I get an invalid use of property then it ends.
    if you could could you make me an access database file with the tables(err the column things) of: NAME EMAIL PASSWORD IM IMSN WINSOCK_NU CONNECTED
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  13. #13
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    hmmm ok.

    Are ya using the Dtatacontrol or not?

    If not put one on ya form! Arrghh Jethro's gonna kill me!

    On the connect string you have:

    Set db.Connect = "C:\Program Files\Microsoft Visual Studio\VB98\fwnmcnSERVER"
    I've got rid of the dbase part! also put a extension in there.

    i.e .txt etc. whatever the dbase extension is!

  14. #14

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    I am using a data control and its name is data1

    Set db.Connect = "C:\Program Files\Microsoft Visual Studio\VB98\fwnmcnSERVER"

    that still returns Invalid use of property.
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  15. #15
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    ok ok RESTART!

    By reading the tutorial i gather you have the datacontrol on your form set the properties of that control to the required dbase file etc.
    I.e The connect property, the database name property, and record source property!

    Using a variable do this:

    Dim field1 as string

    field1 = data1.recordsource

    Field1 now contains what ever the data controls record source does!
    You can do more!

  16. #16

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    but I want to be able to add names, and the other info into the feilds, the thing I get from that feild1 thing was just the name of my dbase file! that doesnt help me in any way. this whole this is for a server that is holding usernames and names and passwords of people who registered, and Ineed to use the data base to input new info into each field
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  17. #17

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    heck if this all doesnt work out I am going to go with the best alternative to databases... ini files. Thanks anyway. I am out for the night.
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

  18. #18
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Nah **** no dont do that!
    Miss comunication. I persumed you were using access like the most of us!
    Should of stated you werent.

    Ok but why do you want to use variables to do that?

  19. #19

    Thread Starter
    Addicted Member Frankie902's Avatar
    Join Date
    Feb 2001
    Location
    Lindenwold, NJ, USA
    Posts
    217
    well over a winsock first the client sends to the host "REG" which then puts the connection in registration mode, which reads registration commands like. NAMEE, EMAIL, PASSS, etc. so it would send info like: NAMEE Frankie . and when it is read it gets the len of the whole sentdata and then take 6 off and gets the right of that value which leaves you with that name. so I need to be able to get Frankie into my data base, under name and so on. Reason I dont use access is because I only have the microsoft works suite on this computer.
    Using:
    Visual Studio .Net Enterprise
    Visual Basic 6.0 Enterprise

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