|
-
Jun 24th, 2004, 02:09 AM
#1
Thread Starter
New Member
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:
Dim ftpcon As New System.Data.Odbc.OdbcConnection
Dim ftpcom As New System.Data.Odbc.OdbcCommand
Dim ftpdatareader As Odbc.OdbcDataReader
sub init
ftpcon.ConnectionString = "File Name=" & Application.StartupPath.ToString & "\ftpserver.udl"
ftpcom.Connection = ftpcon
ftpcon.open
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
-
Jun 24th, 2004, 02:38 AM
#2
Fanatic Member
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:
dim cn as new odbcconnection()
dim s as new streamreader(application.startuppath & "\constr.txt")
cn.connectionstring=s.readline()
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...
-
Jun 24th, 2004, 04:31 AM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|