Results 1 to 4 of 4

Thread: database connectivity

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    15

    database connectivity

    hi all,
    actually i want to connect my sql server database with visual basic application through coding.any body .
    anybody can suggest me the step by step process of database connectivity with sql server.
    give me proper answer.
    regards,
    abhishek

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: database connectivity

    In vb.net theres a class called SqlConnection that opens a connection to sql server.
    "The dark side clouds everything. Impossible to see the future is."

  3. #3
    Lively Member
    Join Date
    Dec 2006
    Posts
    96

    Re: database connectivity

    Hi Abhi

    Use this code to connect to SQL Server in VB.6.0

    Code:
    'General Declaration
    Dim con As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    
    Private Sub Form_Load()
        con.Open "Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Data Source=ASHOK"
        rs.CursorLocation = adUseClient
        rs.Open "select * from Employee", con, adOpenDynamic, adLockReadOnly
        Set DataGrid1.DataSource = rs
    End Sub
    This will Help u out...

  4. #4
    Hyperactive Member kxcntry99's Avatar
    Join Date
    Jun 2006
    Location
    Pennsylvania
    Posts
    342

    Re: database connectivity

    If you are using .Net there is a great tutorial in my signature...
    Microsoft Office Integration:Useful Database Links:
    Connection Strings


    Im a pogramar
    Iam a programer
    I’m a programor

    I write code!

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