Results 1 to 3 of 3

Thread: connecting to mysql using odbc and udl

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    Philippines
    Posts
    11

    connecting to mysql using odbc and udl

    Good day.


    i have a problem in connecting to mysql using udl and odbc. i have created a udl that connects to a mysql data source using odbc

    VB Code:
    1. Dim ftpcon As New System.Data.Odbc.OdbcConnection
    2.     Dim ftpcom As New System.Data.Odbc.OdbcCommand
    3.     Dim ftpdatareader As Odbc.OdbcDataReader
    4.  
    5.    sub init
    6.  
    7.     ftpcon.ConnectionString = "File Name=" &    Application.StartupPath.ToString & "\ftpserver.udl"
    8.         ftpcom.Connection = ftpcon
    9.  
    10.     ftpcon.open
    11.  
    12.    end sub


    when i try to execute the code above, error states that "keyword not supported, file name" , but in other connections using oledb it works fine. does odbc.net doesnt support udl's? im using visual studio.net 2003



    any help would be greatly appreciated. Thank you very much

  2. #2
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    i don't know how to use udl but i tested your code with sql and i got something like unknown connection. i do this
    VB Code:
    1. dim cn as new odbcconnection()
    2. dim s as new streamreader(application.startuppath & "\constr.txt")
    3. cn.connectionstring=s.readline()
    4. cn.open()
    i don't know if this helps or not. i [also] just want to know the best way of doing this. i'm sure mine is bad...

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    Philippines
    Posts
    11
    thnx very much for the reply. I know the coz of the prob, in odbc.net udl's are not supported, so used "DSN = dsname", it works. I dont know about earlier vb versions.

    thnx again..

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