Hi folks. I hope y'all haven't gone bush for the weekend and left me to my own devices. I definitely can't be trusted on my own!
I'm trying to transition from Classic Asp to VB.NET and I have to confess some confusion when it comes to using a MySQL database.
Here is the initial connection code that works fine for me on a classic asp page:
I realize there are lots of different types of connections, but as I will eventually be trying to convert existing asp pages to aspx, it would be good if I could stick as close as possible to what I'm already using.
Anyway, trying to get a valid connection in VB.NET terms, this is what I've got so far:
As you can see I'm not trying to do anything with the database yet, other than to get an error free connection.
That code results in Exception Detail:
System.ArgumentException: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.
Realizing that the error message is only providing an example I tried it anyway:
But that's also clearly wrong, and as you can see I'm now just guessing, so can somebody please point me in the right direction with the simplest possible solution. I can add more complexity as I progress.
ALSO...
What DLL, if any, do I need to put in the cgi-bin, and where do I get it? I've been dropping DLLs in there like chook feed!
TIA
I'm trying to transition from Classic Asp to VB.NET and I have to confess some confusion when it comes to using a MySQL database.
Here is the initial connection code that works fine for me on a classic asp page:
VB.NET:
' Open a connection to the database.
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open = "DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost; DATABASE=databasename; UID=username; PWD=password")
I realize there are lots of different types of connections, but as I will eventually be trying to convert existing asp pages to aspx, it would be good if I could stick as close as possible to what I'm already using.
Anyway, trying to get a valid connection in VB.NET terms, this is what I've got so far:
VB.NET:
<head runat="server">
<title>MySQL Connection Test</title>
<script runat="server" language="VB">
Sub Page_Load()
Dim objConn As OleDbConnection
objConn = New OleDbConnection("Driver={MySQL ODBC 5.1 Driver}; Server=localhost; Database=databasename; _
User=username; Password=password; Option=3;")
objConn.Open()
' Move along folks; nothing to see here!
objConn.Close()
End Sub
</script>
</head>
As you can see I'm not trying to do anything with the database yet, other than to get an error free connection.
That code results in Exception Detail:
System.ArgumentException: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.
Realizing that the error message is only providing an example I tried it anyway:
VB.NET:
objConn = New OleDbConnection("Provider=SQLOLEDB; Driver={MySQL ODBC 5.1 Driver};Server=localhost; _
Database=dlguard_caos; User=cache7admin;Password=pWw447944b;Option=3;")
But that's also clearly wrong, and as you can see I'm now just guessing, so can somebody please point me in the right direction with the simplest possible solution. I can add more complexity as I progress.
ALSO...
What DLL, if any, do I need to put in the cgi-bin, and where do I get it? I've been dropping DLLs in there like chook feed!
TIA