Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Database connection

Status
Not open for further replies.

Dashsa

Programmer
Aug 7, 2006
110
US
Hello
I have a Access Database that is linked to a Quick Books Database i am using asp and JScript to connect to the DB but am getting the error "Driver's SQLSetConnectAttr failed"
here is the code:
Code:
<%@ LANGUAGE="JScript"%>
<!-- #include file="adojavas.inc" -->
<HTML>
<HEAD>
<TITLE>View PO Numbers</TITLE>
</HEAD>
<%
var recordSet = Server.CreateObject("ADODB.RecordSet");
recordSet.Open("select Vendor.Name from Vendor" , "DSN=DashQB" );

%>
<BODY leftmargin="0" topmargin="0" rightmargin="0">
		<center>
<table width="100%"  bgcolor="#CCCCCC" cellpadding="0" cellspacing="0">
	<tr>
	<td align="center">&nbsp;
			
	</td>
	</tr>
	<tr>
	<table width="100%" >
	<tr height="300">
	</center><td valign="top" align="center" bgcolor="#999999">
	<table width="100%">
	 <tr>
		<th bgcolor="#073c80"><font color="#FFFFFF">ID</th>
	 </tr>
 <%
 while(!recordSet.EOF)
 {
 %>
 <tr>
 <td bgcolor="#9aadfc"><font size="-1" ><%=recordSet("Name")%></font></td>
</font></tr>
<%
recordSet.MoveNext();
}%>
</script>
</table>
</td>
	</tr>
		</table>
	</tr>
	</table>
</center>
</BODY>
</HTML>

I think it must have something to do with the line "recordSet.Open("select Vendor.Name from Vendor" , "DSN=DashQB" );"

thanks
in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top