Results 1 to 3 of 3

Thread: VB6 MSSQL Windows Authentication & Select Count in TextBox

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    5

    VB6 MSSQL Windows Authentication & Select Count in TextBox

    All,

    I am looking for an example of the windows authenticated connection to an MSSQL DB and a select count statement in a textbox in my form.

    I have this connection string:

    Code:
    Dim SQLCon As ADODB.Connection
    
     
    Set SQLCon = New ADODB.Connection
    
    With SQLCon 
    Provider=SQLOLEDB.1;Integrated Security=True;Initial Catalog=MY DATABASE;Data Source=MY SERVER;Persyst Security Info=False;Command Properties='Command Time Out=45'" 
    End With
    Can I simply just paste this into my form_onload? Also how to I reference this connection when I then go to add my SQL query to textboxes etc?

    Does anyone have any example code they would be willing to share or take the time to explain this to me.

    Any replice will be much appreciated.

    Thanks,

    Ben.
    Last edited by whitelockben; Feb 12th, 2012 at 01:39 PM.

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