If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Database connection in asp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-03, 01:53
sankari sankari is offline
Registered User
 
Join Date: Jan 2003
Location: india
Posts: 2
Question Database connection in asp

Hi ASP Experts,

Can u solve this problem. I work in a network. The code for connecting to a database is given below:
<%
set con=server.createobject("adodb.connection")
con.open "Driver={microsoft access driver (*.mdb)}; uid=;pwd=; dbq=" &

server.mappath("trc.mdb")
set rs=server.createobject("adodb.recordset")
qry="select * from imm_projects;"
rs.open qry,con%>

I don't want to use dsn.
I get the following error:

Error Type:
Provider (0x8000FFFF)
Catastrophic failure
/trc/t-projects.asp, line 10


Thanks in advance
sankari
Reply With Quote
  #2 (permalink)  
Old 01-22-03, 05:30
jchandru jchandru is offline
Registered User
 
Join Date: Jan 2003
Posts: 6
Please put the full code.
Reply With Quote
  #3 (permalink)  
Old 01-22-03, 05:39
sankari sankari is offline
Registered User
 
Join Date: Jan 2003
Location: india
Posts: 2
database connection in asp

<html>
<BODY alink="#ff0000" vlink="yellow" link="blue" BGCOLOR="" BACKGROUND="images\backgrnd.gif" leftmargin="0" topmargin="10" rightmargin="0">

<%
set con=server.createobject("adodb.connection")
con.open "Driver={microsoft access driver (*.mdb)}; uid=;pwd=; dbq=" & server.mappath("trc.mdb")
set rs=server.createobject("adodb.recordset")
qry="select * from imm_projects;"
rs.open qry,con
recno=0
while not rs.eof
recno=recno+1
%>


<style>
td {align: justify;} p {align: justify;}
</style>

<STYLE>
.txtBox
{
BORDER-BOTTOM: #0061A0 solid 1px;
BORDER-LEFT: #0061A0 solid 1px;
BORDER-RIGHT: #0061A0 solid 1px;
BORDER-TOP: #0061A0 solid 1px;
}
</style>

<table border="0" width="90%" cellspacing="0" cellpadding="0">

<tr><td width="50%"></td>
<td align=right><a href="content1.asp"><img src="images\demo1.jpg"></a></td>
<td align=right><a href="prodhome1.asp"><img src="images\demo1.jpg"></a></td>
</table>
<br>
<br>
<table>
<td width="25%" valign=top>
<table height="55%">

<tr><td width="10%"><img src="images\1.jpg"></a></td></tr>
<tr><td width="10%"><a href="t-publications.asp"><img src="images\2.jpg"></a></td></tr>
<tr><td width="10%"><a href="t-staff.asp"><img src="images\3.jpg"></a></td></tr>


</table>
</td>
<td width="55%" align=center valign="top">

<table align=center width="100%" height="50%" border="2" cellspacing="2" cellpadding="2">
<tr><td colspan=4 width="80%" align="center"><b><font face="ms serif" size=+2>Immunology - Projects &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;</b></td></tr>
<tr><td width="10%">Code</td><td width="10%">Name</td><td width="20%">Project Incharge</td><td>Project Details</td></tr>

<tr><td><%=rs("proj_code")%></td><td><a href><%=rs("proj_name")%></a></td><td><%=rs("proj_incharge")%></td><td><%=rs("proj_details")%></td></tr>
<%rs.movenext
wend%>
</table>

</td>


</table>

<%rs.close
set rs=nothing
set con=nothing
%>

</body>
</html>
hilalbrk@emirates.net.ae
Reply With Quote
  #4 (permalink)  
Old 01-24-03, 10:43
pjames pjames is offline
Registered User
 
Join Date: Jan 2003
Posts: 23
Have you check to make server.mappath("trc.mdb") is providing the correct path to your file?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On