|
 |
asp_databases thread: problem with OLE DB
Message #1 by "hilma" <hilma76@l...> on Mon, 23 Oct 2000 08:30:02 +0100
|
|
I have office2000 in my machine and the book "beginning ASP Databases "
said I can use Microsoft.Jet.OLEDB.4.0 , but when trying to run my asp
page below , I get the message :
ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed.
<html>
<head>
<title>less dns</title>
</head>
<body>
<h3>oledb</h3>
<%
dim oConp
dim oRSp
dim strSource
Set oConp=Server.CreateObject("ADODB.connection")
Set oRSp=Server.CreateObject("ADODB.recordset")
strSource = "Provider=Microsoft.Jet OLEDB.4.0"
strSource= strSource & "; Data Source=C:\barangDB.mdb"
oConp.ConnectionString= strSource
oConp.open
sqlText= "SELECT tgl_jual, kode_brg, jumlah, harga_jual FROM transaksi "
sqlText=sqlText & " WHERE tgl_jual BETWEEN #9/1/00# AND #9/30/00# ;"
oRSp.open sqlText, oConp
oRSp.movefirst
response.write "<table border=1><tr>"
for each fieldfield in oRSp.Fields
response.write "<th>" & fieldfield.name & "</th>"
next
response.write "</tr>"
response.write "<tr><td>"
response.write oRSp.GetString(,,"</td><td>","</td></tr><tr><td>"," ")
response.write "</td></tr></table>"
oRSp.close
set oRSp=nothing
oConp.close
set oConp=nothing
%>
</body>
</html>
I tried another example on the book and it also doesn't run. The page told
that :
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
<html>
<head>
<title>oledb</title>
</head>
<body>
<h3>oledb</h3>
<%
dim oConb
dim varString
set oConb=Server.CreateObject("ADODB.connection")
varString= "Provider=Microsoft.Jet.OLEDB.4.0"
varString=varString & "; Data Source=C:\My Documents\Sailors.mdb"
'varString=oConb.ConnectionString
oConb.open
dim oRSb
set oRSb=Server.CreateObject("ADODB.recordset")
sqlText="SELECT BoatName FROM Boats ;"
oRSb.open sqlText, oConb
response.write "<table><tr><td>"
dim counter
for each fieldfield in oConb.properties
counter=counter +1
response.write "<tr><td>" & counter & "</td>"
response.write "<td>" & fieldfield.name & "</td>"
response.write "<td>" & fieldfield.value & "</td>"
next
response.write "</table>"
oRSb.close
set oRSb=nothing
oConb.close
set oConb=nothing
%>
</body>
</html>
Actually, The Chapter make me dizzy. Can anyone help me?
Message #2 by John Doolan <Johnd@m...> on Mon, 23 Oct 2000 14:07:44 +0100
|
|
It looks like your connection string is incorrect. Here's an example of one
that works on one of my sites. Note the '.' after 'Jet'.
- John Doolan
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" &
Server.Mappath("/database/mydb.mdb") & ";" & _
"User Id=admin;" & _
"Password=;"
-----Original Message-----
From: hilma [mailto:hilma76@l...]
Sent: 23 October 2000 08:30
To: ASP Databases
Subject: [asp_databases] problem with OLE DB
I have office2000 in my machine and the book "beginning ASP Databases "
said I can use Microsoft.Jet.OLEDB.4.0 , but when trying to run my asp
page below , I get the message :
ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed.
<html>
<head>
<title>less dns</title>
</head>
<body>
<h3>oledb</h3>
<%
dim oConp
dim oRSp
dim strSource
Set oConp=Server.CreateObject("ADODB.connection")
Set oRSp=Server.CreateObject("ADODB.recordset")
strSource = "Provider=Microsoft.Jet OLEDB.4.0"
strSource= strSource & "; Data Source=C:\barangDB.mdb"
oConp.ConnectionString= strSource
oConp.open
sqlText= "SELECT tgl_jual, kode_brg, jumlah, harga_jual FROM transaksi "
sqlText=sqlText & " WHERE tgl_jual BETWEEN #9/1/00# AND #9/30/00# ;"
oRSp.open sqlText, oConp
oRSp.movefirst
response.write "<table border=1><tr>"
for each fieldfield in oRSp.Fields
response.write "<th>" & fieldfield.name & "</th>"
next
response.write "</tr>"
response.write "<tr><td>"
response.write oRSp.GetString(,,"</td><td>","</td></tr><tr><td>"," ")
response.write "</td></tr></table>"
oRSp.close
set oRSp=nothing
oConp.close
set oConp=nothing
%>
--- <BR>
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND<BR>
INSIGHTS IN YOUR INBOX!<BR>
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips,
tools, and <BR>
developments from the experts. Sign up for one or more of EarthWeb?s<BR>
FREE IT newsletters at http://www.earthweb.com today! <BR>
---<BR>
You are currently subscribed to asp_databases as: johnd@m...<BR>
$subst('Email.Unsub')<BR>
</BODY>
</html>
I tried another example on the book and it also doesn't run. The page told
that :
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
<html>
<head>
<title>oledb</title>
</head>
<body>
<h3>oledb</h3>
<%
dim oConb
dim varString
set oConb=Server.CreateObject("ADODB.connection")
varString= "Provider=Microsoft.Jet.OLEDB.4.0"
varString=varString & "; Data Source=C:\My Documents\Sailors.mdb"
'varString=oConb.ConnectionString
oConb.open
dim oRSb
set oRSb=Server.CreateObject("ADODB.recordset")
sqlText="SELECT BoatName FROM Boats ;"
oRSb.open sqlText, oConb
response.write "<table><tr><td>"
dim counter
for each fieldfield in oConb.properties
counter=counter +1
response.write "<tr><td>" & counter & "</td>"
response.write "<td>" & fieldfield.name & "</td>"
response.write "<td>" & fieldfield.value & "</td>"
next
response.write "</table>"
oRSb.close
set oRSb=nothing
oConb.close
set oConb=nothing
%>
--- <BR>
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND<BR>
INSIGHTS IN YOUR INBOX!<BR>
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips,
tools, and <BR>
developments from the experts. Sign up for one or more of EarthWeb?s<BR>
FREE IT newsletters at http://www.earthweb.com today! <BR>
---<BR>
You are currently subscribed to asp_databases as: johnd@m...<BR>
$subst('Email.Unsub')<BR>
</BODY>
</html>
Actually, The Chapter make me dizzy. Can anyone help me?
|
|
 |