DWebPro supports the stand alone install and uninstall of the following ODBC drivers:
-
MySQL
-
Firebird
-
PostgreSQL
-
SQLite
To activate the ODBC support, we recommend you to use our preconfigured add-on packages, which can be downloaded from the DWebPro Web site (see Add-On Packages topic).
The ODBC support is equal for each database, one field for the activation and one that points to the driver folder. Here is an example of the MySQL support:
[MySQL] ODBC=0 ODBCFolder=
The following drivers are installed by DWebPro and can be used for non-DSN connections:
-
Firebird/InterBase® Driver for DWebPro
-
MySQL ODBC 3.51 Driver for DWebPro
-
PostgreSQL Unicode for DWebPro
-
PostgreSQL ANSI for DWebPro
-
SQLite ODBC Driver for DWebPro
-
SQLite ODBC (UTF-8) Driver for DWebPro
-
SQLite3 ODBC Driver for DWebPro
Some examples of non-DSN connections are available at: http://www.connectionstrings.com.
Here is an example for use MySQL odbc with ASP Classic 3.0 (VBScript):
<%
Dim DSN, conn
DSN = "Driver={MySQL ODBC 3.51 Driver for DWebPro};" & _
"Server=127.0.0.1;" & _
"Port=" & Request.ServerVariables("DWEBPRO_MYSQL_PORT") & ";" & _
"Database=test;" & _
"User=root;" & _
"Password=;" & _
"Option=3;"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open(DSN)
%>
Here is the same example in ASP.NET (VB):
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.ODBC" %>
<script language="VB" Runat="server">
sub Page_Load
Dim strConn as string
strConn = "Driver={MySQL ODBC 3.51 Driver for DWebPro};" & _
"Server=127.0.0.1;" & _
"Port=" & Environment.GetEnvironmentVariable("DWEBPRO_MYSQL_PORT") & ";" & _
"Database=test;" & _
"User=root;" & _
"Password=root;" & _
"Option=3;"
Dim MyConn as New ODBCConnection(strConn)
MyConn.Open()
end sub
</script>
In ASP.NET you can use the global.asax file to set the ConnectionString
configuration field at runtime using a code like the following:
<script language="VB" runat="server">
Sub Application_Start(Sender As Object, E As EventArgs)
ConfigurationManager.AppSettings("ConnectionString") = "Driver={MySQL ODBC 3.51 Driver for DWebPro};" & _
"Server=127.0.0.1;" & _
"Port=" & Environment.GetEnvironmentVariable("DWEBPRO_MYSQL_PORT") & ";" & _
"Database=test;" & _
"User=root;" & _
"Password=root;" & _
"Option=3;"
End Sub
</script>


