Results 1 to 4 of 4

Thread: Issue with connection database in Visual Basic

  1. #1
    Join Date
    Dec 2008
    Posts
    135

    Issue with connection database in Visual Basic

    Hello friends,

    I am not able to retrieve the data from database in text boxes through combo box.Where combo box contains roll no which is when selected shows the related information of that roll no from that database.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Issue with connection database in Visual Basic

    Sure i will help you out with this before that may i know by which Database are you using for your connectivity.

  3. #3
    Join Date
    Dec 2008
    Posts
    135

    Re: Issue with connection database in Visual Basic

    I am using adodc as my Connectivity Database

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: Issue with connection database in Visual Basic

    Try to use the following code and i am sure it will work for you and try to use ADODB

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
    Dim esql As String
    esql = "select * from testable where RollNo=" & val(Text1)
    Adodc1.RecordSource = esql
    If Adodc1.Recordset.RecordCount > 0 Then
    Adodc1.Refresh
    label1= Adodc1.Recordset.Fields(0)
    label2=adodc1.recordset.fields(1)
    'and so  on
    'better to use Labels so that user does not change data as in Textbox
    End If
    End Sub

Similar Threads

  1. Connect Visual Basic with SQL server database
    By samualres in forum Software Development
    Replies: 4
    Last Post: 28-11-2009, 08:37 AM
  2. Visual Basic express sql server connection
    By shilong in forum Software Development
    Replies: 3
    Last Post: 06-08-2009, 12:39 PM
  3. Issue with Visual Basic Code
    By Harshini in forum Software Development
    Replies: 1
    Last Post: 10-04-2009, 04:21 PM
  4. Visual Basic 2005 or Visual Basic 6
    By Aasha in forum Software Development
    Replies: 5
    Last Post: 15-01-2009, 06:56 PM
  5. Visual Basic on LAN
    By djbbenn in forum Software Development
    Replies: 2
    Last Post: 05-08-2008, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,046,459.50263 seconds with 17 queries