|
-
Jun 12th, 2003, 06:56 AM
#1
Thread Starter
PowerPoster
Connection to MySQL
Hi, What would the Provider name be for a MySQL DB? I'm using the oledb connection type and must provide a provider name and i have no idea what to put as the provider for MySQL.
Here's the code i have but it no worky...
VB Code:
Imports System.Data.OleDb
Public Class specialeventinfo
Inherits System.Web.UI.Page
Protected WithEvents Text1 As System.Web.UI.HtmlControls.HtmlInputText
Protected WithEvents txtEventInfo As System.Web.UI.HtmlControls.HtmlTextArea
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Application("Connection") Is Nothing Then
Dim MySQLConn As OleDbConnection, ConString As String
Try
ConString = "Provider=MySQL;Data Source=111.11.111.11;Initial Catalog=wild;User ID=uid;Password=pwd;"
MySQLConn = New OleDbConnection(ConString)
MySQLConn.Open()
Catch ex As Exception
Response.Write("Connection Error")
End Try
End If
End Sub
End Class
Thanks!
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Jun 12th, 2003, 03:33 PM
#2
Thread Starter
PowerPoster
I've also tried using the Microsoft.Data.ODbc namespace to no avail...
VB Code:
Imports Microsoft.Data.Odbc
Public Class specialeventinfo
Inherits System.Web.UI.Page
Protected WithEvents Text1 As System.Web.UI.HtmlControls.HtmlInputText
Protected WithEvents txtEventInfo As System.Web.UI.HtmlControls.HtmlTextArea
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Application("Connection") Is Nothing Then
Dim MySQLConn As OdbcConnection, ConString As String
Try
ConString = "Driver={MySQL ODBC 3.51 Driver};Server=11.11.11.11;Database=wild;uid=uid;pwd=pwd;option=3"
MySQLConn = New OdbcConnection(ConString)
MySQLConn.Open()
Catch ex As Exception
Response.Write("Connection Error")
End Try
End If
End Sub
End Class
I get this error...
Microsoft.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified at Microsoft.Data.Odbc.OdbcConnection.Open() at OptimaBackEndTest.specialeventinfo.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\OptimaBackEndTest\specialeventinfo.aspx.vb:line 33
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Jun 13th, 2003, 02:21 PM
#3
New Member
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
|