interconnecting VB and SQL

I hav Visual basic 6.0 and recntly I installed Oracle 9i.
I have created tables in SQL.
Now I want to use these tables in VB
but first how to join/inter-connect VB and SQL

Comments

  • : I hav Visual basic 6.0 and recntly I installed Oracle 9i.
    : I have created tables in SQL.
    : Now I want to use these tables in VB
    : but first how to join/inter-connect VB and SQL
    :
    you'll need a code to that.
    for example i had a sql database EIS_Data and the table i wish to connect is perinf for "Personal Information".
    i use ado. so u have to reference it in your project like microfoft activex data objects choose the version u wish to use.
    here the code i use.

    dim conn as adodb.connection
    dim rs as adodb.recordset

    in my form_load event
    Set conn = New ADODB.Connection
    Set rs = New ADODB.Recordset
    conn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=EIS_Data;Data Source=192.168.30.118"
    rs.CursorLocation = adUseClient
    rs.Open "Select * from perinf", conn, adOpenDynamic, adLockOptimistic

    hope it will help
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion