Results 1 to 5 of 5

Thread: writing to a database in vb or .vbs

  1. #1
    Junior Member
    Join Date
    Sep 2004
    Posts
    10

    Question writing to a database in vb or .vbs

    hi guys and gals,

    Wow this place is great to learn from picked up loads of tips hopefuly i will be able to help someone and give loads of help but till then gonna keep learning anyways

    i working in a webcafe and i would like to write to a DB file that has all the usernames, password ect. because the other staff find it hard to use the orginal programe so i though that would be gd anyone know of anygd tut's can u please point me in the right direction im not a total newbie with vbs i did study it at college and pass but writing to database's they didnt teach us ????

    well thnx for your time

    Lee Macdonald

    P.S I ADDed The Database file i want to write to thnx again bye

  2. #2
    AntiOnline n00b
    Join Date
    Feb 2004
    Posts
    666
    Hi,

    A few Questions...


    Are you working in Visual Basic or VB Script .......which verson?

    What back-end you are planning to use ?..............what database Application?...........There are many ways with which you can connect to a database.

    You can use ADODB or using ODBC or if you are making a database in MS-Access 97 and older you can use Jet Engine v4.

    A bit more information after which i will be able to help you .

    --Good luck--

  3. #3
    Junior Member
    Join Date
    Sep 2004
    Posts
    10
    hi,

    i have MS VB 6 and i have MS access 2003

    and i dont know what u mean by back-end i was never shown anything about this at college

    well thnx for your time

    i can upload a copie of the DB if that helps


    THnx for your time lee

  4. #4
    AntiOnline n00b
    Join Date
    Feb 2004
    Posts
    666
    Hi,

    Back End means the database Application .............in your case Visual basic is the Front -End and MS Access is the back end.

    You can use both ADODB to connect to the MS-Acess 2003....


    Code:
    'Declare a connection and recordset object
    Dim con as ADODB.Connection   //the connection 
    dim  rs As ADODB.Recordset   //the recordset where the records from a 
    
    table are fetched
    
    
    Private Sub Form_Load()
       Set con = New ADODB.Connection
    
    Set rs = New ADODB.Recordset
    
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data
     Source= " & App.Path & "\test.mdb"  //this connection string will not work with
     MS-Access 2003 you will have to make your own..this is fro  MS-Access 97
    
    rs.Open "SELECT * From Customer", con, adOpenStatic, adLockOptimistic
    this will fetch the records from the table customer into the recordset rs.......form there you can use them

    Like for displaying the first record fetched by the recordset onot a text box names text1

    text1.text=rs(0)

    will show the record

    To start with ..........try the ADODB Data Control ...........add that to your form and go to it's properties ................Follow the steps Select the type -> make connection string etc.

    I don't have Visual Basic right now ...when i will get my hands on i will try to make you a sample application ........it's very hard to understand Vb this whay without a example application .........

    Get a good book on visual basic it will help

    Btw: I almost forgot to say Welcome to AO


    --Good Luck--

  5. #5
    Junior Member
    Join Date
    Sep 2004
    Posts
    10
    THNX MATE

    I STILL VERY LOST

    BUT THANK YOU AT LEAST NOW I KNOW WHAT DIRECTION TO GO IN THANX

Posting Permissions

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