Visual Basic 6 to SQL Server 2000

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AjGrace
    New Member
    • Jul 2007
    • 7

    Visual Basic 6 to SQL Server 2000

    Hi!

    Im a Beginner in SQL server and I need to know how to connect to it using Visual Basic 6.0 using Ado connection..Tha nks In Advance guys!
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by AjGrace
    Hi!

    Im a Beginner in SQL server and I need to know how to connect to it using Visual Basic 6.0 using Ado connection..Tha nks In Advance guys!
    you can connect through connection string
    Code:
    Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;password=foxglove;Initial Catalog=Dinning;Data Source = (LOCAL)

    Comment

    • AjGrace
      New Member
      • Jul 2007
      • 7

      #3
      Originally posted by hariharanmca
      you can connect through connection string
      Code:
      Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;password=foxglove;Initial Catalog=Dinning;Data Source = (LOCAL)

      Thanks...I Really Appreciate your Help.. But Can I ask another Question..?
      Can I use that connection in Public for example I will use the command "call"

      Ex

      Public Sub OpenConn()

      strconn = "DSN=dbprac " ' this is an Access Database

      Set db = New ADODB.Connectio n

      With db
      .CursorLocation = adUseClient
      .ConnectionStri ng = strconn
      .Open
      End With

      End Sub

      So Everytime that I need the connection in database I just Call OpenConn. Thanks For Helping me..

      Comment

      • sachinkale123
        New Member
        • Jul 2007
        • 37

        #4
        Originally posted by AjGrace
        Thanks...I Really Appreciate your Help.. But Can I ask another Question..?
        Can I use that connection in Public for example I will use the command "call"

        Ex

        Public Sub OpenConn()

        strconn = "DSN=dbprac " ' this is an Access Database

        Set db = New ADODB.Connectio n

        With db
        .CursorLocation = adUseClient
        .ConnectionStri ng = strconn
        .Open
        End With

        End Sub

        So Everytime that I need the connection in database I just Call OpenConn. Thanks For Helping me..


        YEs this is the anothere way to connect...

        Comment

        • sachinkale123
          New Member
          • Jul 2007
          • 37

          #5
          Originally posted by AjGrace
          Thanks...I Really Appreciate your Help.. But Can I ask another Question..?
          Can I use that connection in Public for example I will use the command "call"

          Ex

          Public Sub OpenConn()

          strconn = "DSN=dbprac " ' this is an Access Database

          Set db = New ADODB.Connectio n

          With db
          .CursorLocation = adUseClient
          .ConnectionStri ng = strconn
          .Open
          End With

          End Sub

          So Everytime that I need the connection in database I just Call OpenConn. Thanks For Helping me..

          This is the another way to connect ...
          Sometimes it gives great flexibility in changing servername etc...
          but if DSN file is not installed then connection meight get failed..

          Comment

          • ck9663
            Recognized Expert Specialist
            • Jun 2007
            • 2878

            #6
            Originally posted by sachinkale123
            This is the another way to connect ...
            Sometimes it gives great flexibility in changing servername etc...
            but if DSN file is not installed then connection meight get failed..

            here's a good link.,...

            http://www.connections trings.com/

            Comment

            Working...