为什么我的strConnect中的路径都写对了,还是有错误啊.
郁闷!!刚学.net一个程序没弄对.路径我查了没问题啊,用的是ACCESS 2003
提示这个错误:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:
System.ArgumentException: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB; '.
===========
<%@ import namespace= "system.data "%>
<%@ import namespace= "system.data.oledb "%>
<script language= "vb " runat= "server ">
sub page_load()
dim objConnection as OleDbConnection
dim strConnect as String
dim strCommand as String
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; "
strConnect = "Data Source=E:\Myproject\db\myaccont.mdb "
data_src.text = strConnect
objConnection = new OleDbConnection(strConnect)
try
objConnection.open()
con_open.text = "connection opened successfully. <br/> "
objConnection.Close()
con_close.text = "connection closed. <br/> "
catch e as exception
con_open.text= "connection failed to open. <br/> "
con_close.text = e.ToString()
end try
end sub
</script>
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
</head>
<body>
<h4> Testing the data connection
<asp:Label id= "data_src " runat= "server " /> </h4>
<asp:Label ID= "con_open " runat= "server "/>
<asp:Label ID= "con_close " runat= "server "/>
</body>
</html>
---------
顺便想问一下,下面说的debug具体怎么做啊,网上哪儿有这方面的文章
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true " directive at the top of the file that generated the error. Example:
<%@ Page Language= "C# " Debug= "true " %>
or:
2) Add the following section to the configuration file of your application:
<configuration>