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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch

Status
Not open for further replies.

Dashsa

Programmer
Aug 7, 2006
110
US
Hello,
I hae a DB that is link to Quick Books.
I am trying to simply display Data in a Table called Vendor.
I am getting an error that says " Type mismatch "
it indicates this line of code
Code:
recordSet.Open("select * from Vendor" , "DSN=DashQB" , connect);
Here is all the code:
Code:
<%@ LANGUAGE="JScript"%>
<HTML>
<HEAD>
<TITLE>View PO Numbers</TITLE>
</HEAD>
<%
var connect = Server.CreateObject("ADODB.Connection");
var recordSet = Server.CreateObject("ADODB.RecordSet");
recordSet.Open("select * from Vendor" , "DSN=DashQB" , connect);
%>
<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>
Thanks in advance
David
 
Well, lets' see if the reply works this time.

I am not sure about JScript, but in VBScript I know you open a recordset like this:

Code:
rs.Open "query", "connection", "cursorLocation"

I don't know what "DSN=DashQB" or Connection are, but maybe you have a problem there?

It could be a DSN issue too I suppose, but first lets' figure out what your code means.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Hello,
I dont that is the issue as "connect" is the connection Variable and DSN is the data source name both of which I use often to access databases and manipulate Data .
What I was thinking the issue is that the tables are actually "linked" to a Quick Books database so maybe there is a different way to connect to these type of Linked Databases.
 
I think you only want to use DSN or connection variable, not both.

Is there a password on the QuickBooks database?

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
No, no Passwrd and i have checked the security and have "All" privilages.
I removed the connect var and now I get the following error:
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
it points to the same line of code
Code:
recordSet.Open("select * from Vendor" , "DSN=DashQB" );
Thanks for taking the time to help :)
 
Did you have the same result using your connection variable?

I think you need to be opening your connection variable to a connection string, modeled after the examples you will find on this site:


Then open your recordset like this:

Code:
recordset.Open ("select * from Vendor", connection)

If this does not work, you might want to try the ASP forum.

Hope this helps,

Alex



Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top