Hi,
I want to display data from a database using ASP but I can't. I have a recordset with a connection in a database but appears me the following error in the browser:
The page cannot be displayed.
Bad arguments number or bad assignement property.
The code is:
<%
dim cnn
dim str
dim rs
dim rq
Set cnn=CreateObject("ADODB.Connection")
str="Data Source=INVENT;"
cnn.ConnectionString=str
cnn.Open str
Set rs=Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection=cnn
rq="select * from material"
rs.open rq
while not rs.EOF
rs("Nom") 'The error is in this line
rs.movenext
wend
cnn.Close
%>
The connection to the database is correct. The problem is the recordset and I don't know where the error is.
I would like to know why I can't display data.
Thanks.
I want to display data from a database using ASP but I can't. I have a recordset with a connection in a database but appears me the following error in the browser:
The page cannot be displayed.
Bad arguments number or bad assignement property.
The code is:
<%
dim cnn
dim str
dim rs
dim rq
Set cnn=CreateObject("ADODB.Connection")
str="Data Source=INVENT;"
cnn.ConnectionString=str
cnn.Open str
Set rs=Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection=cnn
rq="select * from material"
rs.open rq
while not rs.EOF
rs("Nom") 'The error is in this line
rs.movenext
wend
cnn.Close
%>
The connection to the database is correct. The problem is the recordset and I don't know where the error is.
I would like to know why I can't display data.
Thanks.