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

Can someone please check this code?

Status
Not open for further replies.

Roberti

Technical User
Mar 2, 2001
96
NL
I have some code and had it working, but I accidently deleted it, and now I can't get it back to work. Came someone perhaps check it?

<%

Dim cnnSimple
Dim rstSimple

Set cnnSimple = Server.CreateObject(&quot;ADODB.Connection&quot;)

cnnSimple.Open &quot;Provider=Microsoft Access Driver (*.mdb);DBQ=&quot; & Server.MapPath(&quot;Database\Storingsformulier.mdb&quot;) & &quot;;PWD=test;&quot;

Set rstSimple = cnnSimple.Execute(&quot;SELECT * FROM basis&quot;)

%>
<table border=&quot;1&quot;>
<%
Do While Not rstSimple.EOF
%>
<tr>
<td><%= rstSimple.Fields(&quot;id&quot;).Value %></td>
<td><%= rstSimple.Fields(&quot;text_field&quot;).Value %></td>
<td><%= rstSimple.Fields(&quot;integer_field&quot;).Value %></td>
<td><%= rstSimple.Fields(&quot;date_time_field&quot;).Value %></td>
</tr>
<%
rstSimple.MoveNext
Loop
%>
</table>
<%

rstSimple.Close
Set rstSimple = Nothing
cnnSimple.Close
Set cnnSimple = Nothing

%>

Thanks, greetings,

Roberti
 
You need a recordset:


cSql = &quot;SELECT * FROM BASIS&quot;
Set cnnSimple = Server.CreateObject(&quot;ADODB.Connection&quot;)
cnnSimple.open [ConnectionString]
Set rstSimple = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rstSimple.Open cSql, cnnSimple


br
Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top