ASP连接MySQL数据库的方法
ASP连接MySQL数据库的方法
ASP等语言连接mysql数据库,可以通过安装mysql的ODBC驱动,通过配置ODBC数据源,连接并操作数据库。
mysql odbc 3.51版
下载地址:
http://dev.mysql.com/downloads/connector/odbc/3.51.html
<%
'测试读取MySql数据库的内容
strconnection="driver={mysql odbc 3.51 driver};database=weste_net;server=localhost;uid=root;password="
'无需配置dsn
set adodataconn = server.createobject("adodb.connection")
adodataconn.open strconnection
strquery = "select * from News"
set rs = adodataconn.execute(strquery)
if not rs.bof then
%>
<table>
<tr>
<td<b>序列号</b></td>
<td><b>标题</b></td>
</tr>
<%
do while not rs.eof
%>
<tr>
<td><%=rs("News_id")%></td>
<td><%=rs("News_Title")%></td>
</tr>
<%
rs.movenext
loop
%>
</table>
<%
else
response.write("无数据.")
end if
rs.close
adodataconn.close
set adodataconn = nothing
set rsemaildata = nothing
%>
PS:若想直接使用以上代码,请将全角符号“<>”替换成半角符号“<>”。
相关文档:
Accessing Distributed Data with the Federated Storage Engine
http://dev.mysql.com/tech-resources/articles/mysql-federated-storage.html
Federated存储引擎可以使几台数据库逻辑上组成一个数据库,其作用相当于Oracle的数据库链接,通俗地说,即在本地建立远程的数据库表的引用。
Mysql需要5.0以上
(1)查看是 ......
The vs2008 and vs2010 don't support the generation LINQ to SQL business objects from a MySQL database, if you drop a MySql table to a Linq to Sql Class, it will popup a "The selected object(s) use an unsupported data provider" error.
Generation tool DBLinq
DbLinq is a LINQ to SQL data co ......
在工作中碰到一个Mysql字段更新问题
在custom表中有一个tariffurl的值中有如下情况:
uploadfiles ariff2007031172720306698.jpg以及uploadfiles ariff2007031172720306690.jpg;uploadfiles ariff2007031172720306691.jpg形式
要更改成uploadfiles/tariff/200703/1172720306698.jpg及 uploadfiles/tariff/200703/11727 ......
在近期的项目维护工作中,时常出现主键重复的异常。经过一系列资料的查询之后,发现时hibernate映射文件配置问题。
mysql提供主键“自动增量”的配置,指定该类型的主键,mysql能够自动加一。
在hibernate映射文件中,关于主键的配置不能是
<generator class="increment"&g ......
<%
Option Explicit
'数据库结构:
'location
'表1 loaction 所在的市 表
' 字段
' loactionid (主键)
' loactionname 名字
'表2 district 所在的县 表
' 字段
' locationid (主键)
' districtid
'&n ......