Re: [Arrowheadasp-users] Hello, I got this ASP Error.
Status: Alpha
Brought to you by:
lazerdye
|
From: Terence H. <laz...@tr...> - 2003-01-06 15:53:04
|
Dear Leyland Chui,
I am sorry to say, but updating the result set is not yet implemented.
It's definitely on the TODO list, and will probably be one of the next
things implemented. In CVS I have most of ADODB.Command and
ADODB.Connection completed, but ADODB.RecordSet is a big one and will
take some time.
Sincerely,
Terence Haddock
On Fri, 2003-01-03 at 12:29, Leyland Chui wrote:
> Dear All,
>
> On the JAVA's ASP, How can I write data on database using ADODB?
>
> IIS/ASP-DSNLESS (It's working) / ChiliASP-DSNLESS (Not Sure, Should Be Work)
>
> <%
> NewsConStr = "DRIVER={MySQL Driver};SERVER=10.0.0.1;DATABASE=news;UID=news;PWD=news; OPTION=35"
> Set Conn=Server.CreateObject("ADODB.Connection")
> Set rs=Server.CreateObject("ADODB.RecordSet")
> SQL = "SELECT * From webs where id=1"
> Conn.open NewsConStr
> rs.open SQL,conn,2,2 ' <--- set 2,2 enable read/write, it will be set read-only without it. (Tested on IIS)
>
> If rs Is Nothing or rs.EOF Then
> Response.Write "News ID NOT FOUND"
> Response.End
> End If
>
> rs("clicks")=rs("clicks") +1
> rs.update
> rs.close
> conn.close
>
> %>
>
> On The JAVA's ASP, It contains errors.
>
> <%
>
> Server.CreateObject("java:org.gjt.mm.mysql.Driver")
> Set Conn = Server.CreateObject("ADODB.Connection")
> SQL = "SELECT * From webs where id=1"
> Conn.open "jdbc:mysql://10.0.0.1/news?user=news&password=news"
> Set rs = Conn.execute(SQL)
>
> If rs Is Nothing or rs.EOF Then
> Response.Write "News ID NOT FOUND"
> Response.End
> End If
>
> rs("clicks")=rs("clicks") +1
> rs.update
>
> %>
>
> Error Output Is
>
> java.lang.RuntimeException: Setting value of read-only variable
> at com.tripi.asp.ADODB.RecordSet$FieldsMap.put(RecordSet.java:337)
> at com.tripi.asp.ADODB.RecordSet.put(RecordSet.java:302)
> at com.tripi.asp.JavaObjectNode$JavaAccessorNode.setValue(JavaObjectNode.java:284)
> at com.tripi.asp.SetValueNode.execute(SetValueNode.java:132)
> at com.tripi.asp.BlockNode.execute(BlockNode.java:131)
> at com.tripi.asp.AspThread.run(AspThread.java:74)
> at java.lang.Thread.run(Thread.java:536)
> File /var/tomcat4/webapps/aspfiles/news.asp line 14: java.lang.RuntimeException: Setting value of read-only variable
>
> Best Regards,
> Leyland Chui
>
>
>
>
--
Terence Haddock <laz...@tr...>
|