General discussion

  • Creator
    Topic
  • #2288517

    Linking VB with SQL Server

    Locked

    by chikukwa ·

    Im trying to link VB to an SQL database.Any code samples will be welcome

All Comments

  • Author
    Replies
    • #3338221

      Reply To: Linking VB with SQL Server

      by chavdaraju ·

      In reply to Linking VB with SQL Server

      download the code from vbcodes.com or codeguru.com

    • #3336331

      Reply To: Linking VB with SQL Server

      by ahar ·

      In reply to Linking VB with SQL Server

    • #3240591

      Reply To: Linking VB with SQL Server

      by hemal ·

      In reply to Linking VB with SQL Server

      Hi,
      To connect VB with SQL You just need few lines of codes..i’ll give you hints,,

      1)first define connection with passing necessary parameters
      2)Then define a command or you can use an adodb connection.
      3) If you use command, write following lines
      with cmdXYZ
      .active connection = ‘your connection”
      .command type = ‘stored procedure’ or ‘string’
      .command text = ‘name of sp’ or ‘string query’
      dim rs as new adodb.recordset
      rs.recordset = .execute
      END with

      okay,,
      all the best

    • #3051798

      Reply To: Linking VB with SQL Server

      by toanisht ·

      In reply to Linking VB with SQL Server

      1. Create a Data Source Name (DSN)
      2. Select the database while you create the DSN.
      3. Add reference to Microsoft ActiveX Data objects….
      Open VB and the Project->References
      4. Write the following code…
      dim con as adodb.connection
      dim rs as adodb.recordset

      set con=new adodb.connection
      set rs=new adodb.recordset

      con.open “DSN=Name_Of_DSN”
      rs. open “select * from table_name”,con


      rs.close
      con.close

      set rs=nothing
      set con=nothing

    • #2829118

      Dear Sir

      by man_man ·

      In reply to Linking VB with SQL Server

      iam Mukund Garodhara From india
      I wanto to Know about sql and vb linking
      Please Guide me

Viewing 4 reply threads