linking database(access) to vb6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ayumi
    New Member
    • Sep 2007
    • 1

    linking database(access) to vb6

    hi guys!! i'm a newbie here and hope you could help me out with my dilemma..
    i have a database and now i want to link it with VB6..i don't know how to start it..some are telling me about connection strings, ADO and OLE DB,.the program seems to be simple, yet i don't know how to do it..i'm just with VB..

    the program should provide all the specifications of the conductor <coming form the database> being input by the user.

    hope you could help me..thanks!!
  • Ack Programming
    New Member
    • Sep 2007
    • 8

    #2
    Originally posted by ayumi
    hi guys!! i'm a newbie here and hope you could help me out with my dilemma..
    i have a database and now i want to link it with VB6..i don't know how to start it..some are telling me about connection strings, ADO and OLE DB,.the program seems to be simple, yet i don't know how to do it..i'm just with VB..

    the program should provide all the specifications of the conductor <coming form the database> being input by the user.

    hope you could help me..thanks!!
    I had the same problem when I started
    first from the Project Menu Select Componints
    Check the checkbox with the "Microsoft ADO Data Control"
    Drag the control to your form
    Steps 1
    You Could:
    -Go to it's "Connection String" Property and Follow The Steps Thrue
    -After doing so you can bind controls to the controler
    Steps 2
    Or you Could:
    -in a Module or MDI Form Declare Public The Following
    Public cnn As New ADODB.Connectio n
    Public rcs1 As New ADODB.Recordset

    then your connection and Statements are in SQL format all the way from there

    cnn.ConnectionS tring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & App.Path & "\database. mdb"
    cnn.Open
    cnn.CursorLocat ion = adUseClient
    -database.mdb - is the name of your database
    and statements like

    rcs1.Open"Selec t * From [Tabel]",cnn, adOpenDynamic, adLockOptimisti c
    -Tabel - Tabel Within You Database
    -cnn - Refering To Your connection string
    -adOpenDynamic,a dLockOptimistic - Operator(option an)

    Comment

    Working...