Groups > Design > Macromedia Dreamweaver MX > Re: How to connect to MySqL Using dreamweaver,




How to connect to MySqL Using dreamweaver,

How to connect to MySqL Using dreamweaver,
Sat, 10 Nov 2007 20:53:54 +000
Im using vista, the site its built, it test ok, i can write pages in
dreamweaver-i have mysql  administrator 1.2.12 set up i lo in to it run queries
and all, i try to connect the database in dreanweaver but i can make a OLE DB
connection, nor SQL server connection...acording to the totorial i have, it
shows that it depends what king of page you are making, I tried ASP VBscript and
also ASP.NET C#, engine wise

ASP.NET  (Interface)OLE DB or which 1?...   for engine what showl i use?what's
easear( Microsoft Jet Provider,  or  Microsoft SQL Server Provider or Microsoft
Oracle provider)

thank you so much to the forum admins..

leny acosta.
l3ny00@gmail.com
Post Reply
Re: How to connect to MySqL Using dreamweaver,
Sun, 11 Nov 2007 03:53:31 +000
Hi,

Frankly speaking it would be good to use the Visual Webdeveloper express edition
which is a free product in place of Dreamweaver for ASP.NET C# development.

any how if you are using MySQL with ASP.NET then you can use none of the above
and you will need to download a separate driver from the MySQL website. there
are two type of drivers the ODBC one and the ADO.NET Driver for MySQL. 
as the ODBC is the old connection so i highly reccomend using the ADO.NET driver
for mysql.
for MySQL Native .NET Connector:

downlaod link:

http://dev.mysql.com/downloads/connector/net/5.0.html

Tutorials:

http://dev.mysql.com/doc/refman/5.0/en/connector-net.html
http://aspalliance.com/1429

for ODBC check out the following:

Download:
http://dev.mysql.com/downloads/connector/odbc/3.51.html

Tutorial:

http://www.stardeveloper.com/articles/display.html?article03052201&page=1

and if you are using classic asp again you will need the ODBC driver for MySQL
then use the dsn connection I mean Connect your database using the system dsn
from your control panel and then use that in your dreamweaver.

hope this help

thanks
Post Reply
Re: How to connect to MySqL Using dreamweaver,
Sun, 11 Nov 2007 07:25:40 +000
To connect with MySql you should use the MySql Connect.net, which is mention in
previous answer.

Here is example code to connect:

must declare the namespace:

using MySql.Data.MySqlClient; // Add the MySql.Data.dll in the bin folder of the
wwwroot folder


conn = new MySqlConnection("server=localhost;user id=root; password=root;
database=test;persist security info=True");
        string strSql = "Select id ,name from abc";
        MySqlCommand cmd = new MySqlCommand(strSql, conn);
        conn.Open();
Post Reply
Re: How to connect to MySqL Using dreamweaver,
Mon, 12 Nov 2007 21:40:11 +000
Fist of all thank you T@ the persons that answered me, i was able to resolve
whith the advice given,

Why if a tested connection ok: http://www.l3ny.com/asp/test-ok.gif
and access to data was grandted: http://www.l3ny.com/asp/buala.gif
I added record set and tested rs ok:
http://www.l3ny.com/asp/recorset-testok.gif
Dynamic table was added, saved page, and still got this error:
http://www.l3ny.com/asp/error.gif

This is the code from the page:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/connTest.asp" -->
<%
Dim srArtist
Dim srArtist_cmd
Dim srArtist_numRows

Set srArtist_cmd = Server.CreateObject ("ADODB.Command")
srArtist_cmd.ActiveConnection = MM_connTest_STRING
srArtist_cmd.CommandText = "SELECT ARTISTID, FIRSTNAME, LASTNAME FROM
artgallery.artists ORDER BY LASTNAME ASC" 
srArtist_cmd.Prepared = true

Set srArtist = srArtist_cmd.Execute
srArtist_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 5
Repeat1__index = 0
srArtist_numRows = srArtist_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


And here is the code for the .asp page (which it's store in the connections
folder in site root:
<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO" 
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_connTest_STRING
MM_connTest_STRING = "Provider=MSDASQL.1;Persist Security Info=False;Data
Source=new l3ny"
%>


Thanks.
Post Reply
about | contact