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

ADO problem

Status
Not open for further replies.

AntiEarnie

Technical User
May 2, 2002
215
0
0
US
Hi All. I have run out of things to try and was hoping somone else might have an idea. My data source is good. I can drop this code into VB6 with only a couple changes and get data back. Every time I try this on the web server I don't get anything though.

**** code ****

<HTML>
<HEAD>
<TITLE>ADO test</TITLE>
</HEAD>
<BODY>
<H1> Critter DB </H1>

<%
Dim con
Dim rst
Dim strSQL

Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = 1

Set con = server.CreateObject(&quot;ADODB.Connection&quot;)
con.Open &quot;test_user_conn_to_pdar_db&quot;,&quot;test_user&quot;,&quot;password&quot;

strSQL = &quot;SELECT * FROM TEST_USER.RACE_STATS;&quot;

Set rst = server.CreateObject(&quot;ADODB.Recordset&quot;)
rst.Open strSQL, con, adOpenStatic, _
adLockReadOnly, adCmdText

rst.MoveFirst
%>

<TABLE BORDER>
<TR>
<TD><B>RACE_NAME</B></TD>
<TD><B>STR_DICE</B></TD>
<TD><B>STR_SIDES</B></TD>
</TR>

<%
do while not rst.EOF
%>
<TR>
<TD><%= rst(&quot;RACE_NAME&quot;) %></TD>
<TD><%= rst(&quot;STR_DICE&quot;) %></TD>
<TD><%= rst(&quot;STR_SIDES&quot;) %></TD>
</TR>

<%
rst.MoveNext
loop
%>

<%
' Clean-up time
rst.Close
con.Close
%>

</TABLE>
</BODY>
</HTML>

**** end code ****

If I drop the html stuff and use &quot;New ADOBC.Connection&quot; and &quot;New ADODB.Recordset&quot; I can get data back in VB6. Can anyone see what I'm missing here?
 
Not a single one. Even tried using the debug stuff with Interdev. No errors under VB.
 
Hi,

I've tried your script on my server, only changing what needed to be changed, and it worked perfectly. Are you sure there is something in the database? Do you at least get the columns heading in your browser? I really see nothing wrong with the code.

Here is my code:

<HTML>
<HEAD>
<TITLE>ADO test</TITLE>
</HEAD>
<BODY>
<H1> Critter DB </H1>

<%
Dim con
Dim rst
Dim strSQL

Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = 1

Set con = server.CreateObject(&quot;ADODB.Connection&quot;)
con.Open &quot;lll&quot;,&quot;&quot;,&quot;&quot;

strSQL = &quot;SELECT * FROM monitrices;&quot;

Set rst = server.CreateObject(&quot;ADODB.Recordset&quot;)
rst.Open strSQL, con, adOpenStatic, _
adLockReadOnly, adCmdText

rst.MoveFirst
%>

<TABLE BORDER>
<TR>
<TD><B>RACE_NAME</B></TD>
<TD><B>STR_DICE</B></TD>
<TD><B>STR_SIDES</B></TD>
</TR>

<%
do while not rst.EOF
%>
<TR>
<TD><%= rst(&quot;nom&quot;) %></TD>
<TD><%= rst(&quot;prenom&quot;) %></TD>
<TD><%= rst(&quot;email&quot;) %></TD>
</TR>

<%
rst.MoveNext
loop
%>

<%
' Clean-up time
rst.Close
con.Close
%>

</TABLE>
</BODY>
</HTML>
 

Thanks for verifying that code.

I double checked the data in the table, it's still there. I think I might have somthing now though. I dumped the code into a .asp page and was able to get this error:

Microsoft VBScript runtime (0x800A01FA)
Class not defined:'ADODB'

Why Interdev didn't generate an error I don't know. Though neither does VB6. Is there someplace I have to refrence a library with VBS?

I downloaded MDAC 2.7 and installed it on the server. Still getting the above error though. I haven't found where I set the server side scripting in IIS but I have client side set as VBS in IIS.

Also I tried adding the following lines to my code:
<META name=VI60_DTCSriptingPlatform content=&quot;server (ASP)&quot;>
<META name=VI60_defaultClientScript content=VBScript>


Interdev seems to want to add them, however there was no change in error code after they were added. Never seen them appear anywhere else.
 
I think the Gremlin up and left. After mucking with various things in the code I was able to get it working. However the code is back to the way it was when I posted. EXACTLY the same no less... No changes made to the system or IIS. It is kinda funny that I could get this to work by using trusty notepad. Interdev still dosen't show anything...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top