Forum Discussion

Patrice's avatar
Patrice
Contributor
14 years ago

ADOConnection with DSN

Hi, I'm trying to connect to a database using DSN but not sure about the syntax.



 ' Create a Connection object 

  Set AConnection = ADO.CreateADOConnection



  ' Specify the connection string 

  AConnection.ConnectionString = "DSN=" & varDsn & ";uid=" & varUserid & ";pwd=" & varPassword



AConnection.Open



Also when i type in AConnection(dot) I dont get any properties or methods.





Am I missing something?


5 Replies

  • Hi there,



     ' Create a Connection object 

      Set AConnection = ADO.CreateADOConnection





    When i put in AConnection(dot), i dont get any properties or methods associated with AConnection like (ConnectionString)



    is that normal?



    Thanks,

    Patrice
  • Hi,



    I've tried this in TC 8.50, and Code Completion worked correctly is this case for me. Do you use the latest TC version? What Code Completion settings are enables on the 'Tools | Options... | Panels | Code Editor | Editing' page?

  • Hi there,



    TC8.50 trial version



    Code Completion on Auto-popup



    Regards,

    Patrice
  • Hi,



    Code completion works correctly for me with the same code. If it doesn't appear when you type the dot after typing your variable's name, try pressing Ctrl + Space.