导读:
这个工具其实是MYSQL的组件对象模块.同样它也支持Delphi, Visual Basic, Visual C++, C++ Builder等工具的调用.以下是在ASP里的调用方法.
正确安装MYSQLX之后.ASP即可用一下方法访问MYSQL
...
con = Server.CreateObject("MySQL.Connection");
con.Connect("localhost", "root", "", "MyDatabase", 3306, 0);
sql = "select FirstName, LastName from Customers";
if (!con.Query(sql))
Response.Write("ERROR: ".concat(con.ErrMsg()));
else
{
%> con = Server.CreateObject("MySQL.Connection");
con.Connect("localhost", "root", "", "MyDatabase", 3306, 0);
sql = "select FirstName, LastName from Customers";
if (!con.Query(sql))
Response.Write("ERROR: ".concat(con.ErrMsg()));
else
{
%>
};
%> };
%>
...
本文转自
http://study.qqcf.com/web/249/30645.htm
这个工具其实是MYSQL的组件对象模块.同样它也支持Delphi, Visual Basic, Visual C++, C++ Builder等工具的调用.以下是在ASP里的调用方法.
正确安装MYSQLX之后.ASP即可用一下方法访问MYSQL
...
con = Server.CreateObject("MySQL.Connection");
con.Connect("localhost", "root", "", "MyDatabase", 3306, 0);
sql = "select FirstName, LastName from Customers";
if (!con.Query(sql))
Response.Write("ERROR: ".concat(con.ErrMsg()));
else
{
%> con = Server.CreateObject("MySQL.Connection");
con.Connect("localhost", "root", "", "MyDatabase", 3306, 0);
sql = "select FirstName, LastName from Customers";
if (!con.Query(sql))
Response.Write("ERROR: ".concat(con.ErrMsg()));
else
{
%>
| First name | Last name |
| | |
};
%> };
%>
...
本文转自
http://study.qqcf.com/web/249/30645.htm
本文介绍如何使用ASP通过MySQL.Connection对象连接并查询MySQL数据库。通过创建组件对象模块的方式,实现对数据库中Customers表的FirstName和LastName字段的数据获取。
357

被折叠的 条评论
为什么被折叠?



