Home > front end >  Will query the database elements to an array and to display, please kindly advise!!!!!!
Will query the database elements to an array and to display, please kindly advise!!!!!!

Time:09-25

Will first lookup table _zb, field z_zhjddw maxid data assigned to the variable array ()
<%
Dim maxid ()
Set the conn=Server. CreateObject (" ADODB. Connection ")
Conn. Open="DRIVER={Microsoft Access DRIVER (*. MDB)}; DBQ="& amp; Server. MapPath (" SJXT. MDB)
Set the rs=server. Createobject (" adodb. You ")
Sql1="select z_zhjddw from _zb order by id asc"
Rs. The open sql1, conn, 1, 1
For I=0 To rs. Recordcount
Maxid (I)=rs (I)
Next
Rs. Close
Conn. Close
% & gt;
Then one by one display


<% %=maxid (I) & gt;
<% % next & gt;


Excuse me, I was wrong in there? How to write?

CodePudding user response:


<body>

<% set conn=Server. The CreateObject (" ADODB. Connection ")
Conn. The Provider="Microsoft. Jet. The OLEDB. 4.0" conn. Open (for Server Mappath ("/db/northwind. MDB))
Set the rs=Server CreateObject (" ADODB. You ") rs. Open the "select z_zhjddw from _zb order by id asc", conn
% & gt;
<% % for each x in rs. The Fields & gt; <% % Response. Write (x.v alue) & gt;
<% next
Rs. MoveNext % & gt;

<% loop
Rs. Close
Conn. Close
% & gt;



CodePudding user response:

This variable is x? I want to assign a value to variable, because want to in the vb variables into js reference again

CodePudding user response:

I want to all the data is given variables, this variable at the same time I also want to translate the javascrit language variables, big master know so not achieve? Thank you for the

CodePudding user response:

https://www.w3school.com.cn/tiy/s.asp? F=demo_adoe_getrows

getrows

CodePudding user response:

The execute or getrows type does not match, why?
<%
Dim maxid ()
Set the conn=Server. CreateObject (" ADODB. Connection ")
Conn. Open="DRIVER={Microsoft Access DRIVER (*. MDB)}; DBQ="& amp; Server. MapPath (" SJXT. MDB)
Set the rs=server. Createobject (" adodb. You ")
Sql1="select top 6 z_zhjddw from _zb order by id asc"
Rs. The open sql1, conn, 1, 1
Maxid=conn. Execute (sql1)
% & gt;

Microsoft VBScript runtime error error '800 a000d'

Type mismatch

/ss. Asp, line 11
  • Related